虾仁A 2022-03-29 20:40 采纳率: 78.8%
浏览 58
已结题

React Native 跑夜神模拟器,Android Studio,Genymotion 全部失败

问题遇到的现象和发生背景

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.

问题相关代码,请勿粘贴截图
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
  • 写回答

1条回答 默认 最新

  • 不会写代码的猴子 Android领域优质创作者 2022-03-29 21:02
    关注

    你这是build.gradle同步失败了。
    应该是网络有问题

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 4月7日
  • 已采纳回答 3月30日
  • 创建了问题 3月29日

悬赏问题

  • ¥15 vscode报错如何解决
  • ¥15 前端vue CryptoJS Aes CBC加密后端java解密
  • ¥15 python随机森林对两个excel表格读取,shap报错
  • ¥15 基于STM32心率血氧监测(OLED显示)相关代码运行成功后烧录成功OLED显示屏不显示的原因是什么
  • ¥100 X轴为分离变量(因子变量),如何控制X轴每个分类变量的长度。
  • ¥30 求给定范围的全体素数p的(p-2)/p的连乘积值
  • ¥15 VFP如何使用阿里TTS实现文字转语音?
  • ¥100 需要跳转番茄畅听app的adb命令
  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗