React Native - Невозможно запустить новый проект через response-native-cli в Windows. - PullRequest
0 голосов
/ 14 октября 2019

Я могу инициировать новый проект в CLI с собственным интерфейсом, но получаю сообщение об ошибке при запуске приложения с использованием react-native run-android. Настроен в соответствии с инструкцией в https://facebook.github.io/react-native/docs/getting-started. Приложение Expo, работающее на симуляторе Android без ошибок.

Узел js: 8.11.1 CLI: @ реагировать-сообщество-сообщество / cli @ 2.9.0

Попробовал: понизил NodeJS с 12 до 8.x

Я получаю следующую ошибку в терминале

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 892 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
Downloading https://services.gradle.org/distributions/gradle-5.4.1-all.zip
..............................................................................................................................

Welcome to Gradle 5.4.1!

Here are the highlights of this release:
 - Run builds with JDK12
 - New API for Incremental Tasks
 - Updates to native projects, including Swift 5 support

For more details see https://docs.gradle.org/5.4.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'newkitten'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.4.1.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.4.1.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5m 13s

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'newkitten'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.4.1.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.4.1.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.4.1/gradle-3.4.1.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 5m 13s

    at checkExecSyncError (child_process.js:601:13)
    at execFileSync (child_process.js:621:13)
    at runOnAllDevices (D:\workspace\newkitten\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
    at buildAndRun (D:\workspace\newkitten\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
    at then.result (D:\workspace\newkitten\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
...