问题遇到的现象和发生背景
React Native 跑夜神模拟器,Android Studio,Genymotion 全部失败
已经弄了3天了,求各位指教
yarn run v1.22.18
warning ..\package.json: No license field
$ D:\vscode\React-Native\My\node_modules\.bin\react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 863 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
info Installing the app...
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'My'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:4.2.2.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:4.2.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.2.2/gradle-4.2.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.2.2/gradle-4.2.2.pom'. Received status code 400 from server: Bad Request
> Could not resolve com.android.tools.build:gradle:4.2.2.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/4.2.2/gradle-4.2.2.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/4.2.2/gradle-4.2.2.pom'. Received status code 400 from server: Bad Request
* 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 5s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
at makeError (D:\vscode\React-Native\My\node_modules\execa\index.js:174:9)
at D:\vscode\React-Native\My\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async runOnAllDevices (D:\vscode\React-Native\My\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\vscode\React-Native\My\node_modules\@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.