簡體   English   中英

React-native無法運行android

[英]React-native unable to run-android

接下來: https//facebook.github.io/react-native/docs/getting-started.html ,我創建了一個空項目,並試圖通過執行來運行它:sudo react-native run-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-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

(如果有用,我可以發布剩下的錯誤)。 有人有建議嗎?

更改分發網址:

android/gradle/wrapper/gradle-wrapper.properties

httpshttp

使用以下步驟我解決了錯誤:

  1. 打開build.gradle(node-modules / react-native / ReactAndroid)
  2. 使用http://mirror.nienbo.com/boost/1.57.0/boost_1_57_0.zip更改任務downloadBoost的 src路徑

     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') } 
  3. 執行Gradle Sync

    工具 - > Android - >使用Gradle文件同步項目

將/android/gradle/wrapper/gradle-wrapper.properties中的分發URL從https改為http,並將gradle版本從5.4更改為5.5

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM