无法下载react-android-0.71.4-debug.aar

lfapxunr  于 2023-03-24  发布在  React
关注(0)|答案(1)|浏览(847)

我试图在我的Windows设备上的Android模拟器上安装和运行React-Native应用程序,但我一直收到此错误
失败:构建完成,但有2次失败。

1:任务失败,出现异常。

  • 出了什么问题:任务":app:checkDebugAarMetadata"的执行失败。

无法解析配置“:app:debugRuntimeClasspath”的所有文件。无法转换react-android-0.71.4-debug. aar(com. facebook. react:react-android:0.71.4)以匹配属性{artifactType = android-aar-metadata,com. android. build. api. attributes. BuildTypeAttr = debug,org. gradle. category = library,org. gradle. dependency. bundling = external,org. gradle. libraryelements = aar,org. gradle. status = release,org. gradle. usage = java-runtime}。〉无法下载react-android-0.71.4-debug. aar(com. facebook. react:react-android:0.71.4)〉无法获取资源“https://www.example.com/maven2/com/facebook/react/react-repo.maven.apache.org/maven2/com/facebook/react/react-android/0.71.4/react-android-0.71.4-debug.aar'. > Could not GET 'https://repo.maven.apache.org/maven2/com/facebook/react/react-android/0.71.4/react-android-0.71.4-debug.aar'. > This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (repo.maven.apache.org)

  • 试试看:

使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获取完整信息。=================================================================

2:任务失败,出现异常。

  • 出了什么问题:堆栈溢出错误(无错误消息)
  • 试试看:

使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获取完整信息。=================================================================

构建在2个月50秒内失败
error无法安装应用。请确保您已设置Android开发环境:https://reactnative.dev/docs/environment-setup。错误:命令失败:gradlew.bat应用程序:安装调试-预实际本机开发服务器端口= 8081
失败:构建完成,但有2次失败。

1:任务失败,出现异常。

  • 出了什么问题:任务":app:checkDebugAarMetadata"的执行失败。

无法解析配置":app:debugRuntimeClasspath"的所有文件。无法转换react-android-0.71.4-debug. aar(com. facebook. react:react-android:0.71.4)以匹配属性{artifactType = android-aar-metadata,com. android. build. api. attributes. BuildTypeAttr = debug,org. gradle. category = library,org. gradle. dependency. bundling = external,org. gradle. libraryelements = aar,org. gradle. status = release,org. gradle. usage = java-runtime}。〉无法下载react-android-0.71.4-debug. aar(com. facebook. react:react-android:0.71.4)〉无法获取资源"https://www.example.com/maven2/com/facebook/react/react-androidrepo.maven.apache.org/maven2/com/facebook/react/react-android/0.71.4/react-android-0.71.4-debug.aar'. > Could not GET 'https://repo.maven.apache.org/maven2/com/facebook/react/react-android/0.71.4/react-android-0.71.4-debug.aar'. > This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (repo.maven.apache.org)

  • 试试看:

使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获取完整信息。=================================================================

2:任务失败,出现异常。

  • 出了什么问题:堆栈溢出错误(无错误消息)
  • 试试看:

使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获取完整信息。=================================================================

构建在2个月50秒内失败

at makeError (C:\Users\PHANZ\Desktop\project\Kekeno\node_modules\execa\index.js:174:9)
at C:\Users\PHANZ\Desktop\project\Kekeno\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (C:\Users\PHANZ\Desktop\project\Kekeno\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
at async Command.handleAction (C:\Users\PHANZ\Desktop\project\Kekeno\node_modules\@react-native-community\cli\build\index.js:108:9)

info使用--verbose标志运行CLI以了解更多详细信息。

px9o7tmv

px9o7tmv1#

根据您的问题,您可以在这里做三件事:
1您可以尝试通过在终端中运行以下命令来清除Gradle缓存:./gradlew cleanBuildCache
2如果清除Gradle缓存不起作用,请尝试将Gradle更新到最新版本。
./gradlew wrapper --gradle-version 8.0.2
3您可以尝试通过在www.example.com文件中添加以下行来增加堆栈大小gradle.properties:
org.gradle.jvmargs=-Xss512m
这将使堆栈大小增加到512 MB。
如果现在能用,请告诉我。我也会确保你的互联网连接稳定。

相关问题