react-native打包报错:could not download org.eclipse.paho.client.mqttv3.jar

在build.gradle文件里面改动:

原有代码:

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        maven {
            url "https://repo.eclipse.org/content/repositories/paho-releases/"
        }

        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

更改后:

allprojects {
    repositories {
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } //加入的代码
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        maven {
            url "https://repo.eclipse.org/content/repositories/paho-releases/"
        }

        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

解决了

你可能感兴趣的:(android,react-native)