gpt4 book ai didi

android - 无法获取资源 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'

转载 作者:搜寻专家 更新时间:2023-11-01 00:49:12 35 4
gpt4 key购买 nike

我最近开始使用 react native,但是根据伊朗人的制裁,gradle 不能构建我的第一个项目,所以我使用了 VPN 和 shecan service但我收到以下错误:

my error

我阅读了 React native 说明并按照它们操作,设置了模拟器、react native cli 和 chocolaty 服务。在环境中,我应该在名为 PATH 的变量中定义我的 SDK 的平台工具文件夹。但是在变量中,我已经在用户名和系统变量中有了路径。在编辑中,我已经向它们添加了我的平台工具。但不幸的是,它还没有奏效。

my enviroments

图像中的 PowerShell 错误消息是:

PS C:\Others\RN_projects\React_native_shop\shop_project> react-native run-android

Starting JS server...

Building and installing the app on the device (cd android && gradlew.bat installDebug)... FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring root project 'shop_project'. Could not resolve all artifacts for configuration ':classpath'. Could not resolve com.android.tools.build:gradle:3.2.1.

Required by:

project : Could not resolve com.android.tools.build:gradle:3.2.1. Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'. Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'. Connect to 127.0.0.1:8580 [/127.0.0.1] failed: Connection refused: connect

Could not resolve com.android.tools.build:gradle:3.2.1.

Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'. Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom'.

Connect to 127.0.0.1:8580 [/127.0.0.1] failed: Connection refused: connect

  • 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.

BUILD FAILED in 3s Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html

events.js:173

throw er; // Unhandled 'error' event ^ Error: spawn cmd.exe ENOENT

at Process.ChildProcess._handle.onexit (internal/child_process.js:246:19) at onErrorNT (internal/child_process.js:421:16) at processTicksAndRejections (internal/process/next_tick.js:76:17)

Emitted 'error' event at: at Process.ChildProcess._handle.onexit (internal/child_process.js:252:12) at onErrorNT (internal/child_process.js:421:16) at processTicksAndRejections (internal/process/next_tick.js:76:17)

最佳答案

将此代理信息添加到您的 gradle.properties 文件中:

systemProp.https.proxyPort=9595
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=9595

并在您的 vpn 中设置上述代理端口(例如 9595),例如 psiphon。然后同步项目。

see this post

关于android - 无法获取资源 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54722235/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com