React native无法运行android
以下是:, 我创建了一个空项目,正在尝试通过执行以下操作来运行它: sudo react本机运行android 这就是产生的结果:React native无法运行android,android,react-native,Android,React Native,以下是:, 我创建了一个空项目,正在尝试通过执行以下操作来运行它: sudo react本机运行android 这就是产生的结果: Starting JS server... Building and installing the app on the device (cd android && ./gradlew installDebug... Downloading https://services.gradle.org/distributions/gradle-2.4-al
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug...
Downloading https://services.gradle.org/distributions/gradle-2.4-all.zip
Exception in thread "main" javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
(如果有用的话,我可以发布错误的其余部分)。有人有什么建议吗?我通过以下步骤解决了错误:
在以下位置更改分发url:
android/gradle/wrapper/gradle wrapper.properties
从
https
到http
将/android/gradle/wrapper/gradle-wrapper.properties中的分发url从https更改为http,并将gradle版本从5.4更改为5.5重试下载,应该可以解决问题尝试此解决方案:这很有效。只想补充一点,在React原生项目中,步骤3是不必要的。
task downloadBoost(dependsOn: createNativeDepsDirectories, type: Download) {
// Use ZIP version as it's faster this way to selectively extract some parts of the archive
//src 'https://downloads.sourceforge.net/project/boost/boost/1.57.0/boost_1_57_0.zip'
// change
src 'http://mirror.nienbo.com/boost/1.57.0/boost_1_57_0.zip'
onlyIfNewer true
overwrite false
dest new File(downloadsDir, 'boost_1_57_0.zip')
}