首页 > 解决方案 > 我已经下载了我想在我的 Visual Studio 项目 EXPO 中使用的最新版本的 Gradle 7.3

问题描述

我仔细检查了是否安装了它..

摇篮 7.3

所以没关系..当我输入命令 gradle --daemon 时问题来了

我收到这个错误

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'RentInCars'.
> Could not resolve all files for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:7.2.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/7.2/gradle-7.2.pom
       - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/7.2/gradle-7.2.pom
       - https://jcenter.bintray.com/com/android/tools/build/gradle/7.2/gradle-7.2.pom
     Required by:
         project :

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3/userguide/command_line_interface.html#sec:command_line_warnings

我尝试使用 sudo gradle --daemon.. 仍然给我同样的错误.. 我接下来应该尝试什么?

标签: javascriptandroidreact-nativevisual-studiogradle

解决方案


正如我们在评论中所讨论的,您需要 VPN 但不需要任何 VPN。

您必须知道您的 vpn 在哪个端口上工作。

例如,如果你下载了 psiphone,你可以去设置,然后本地代理端口,你可以添加 12345 作为例如端口。

然后你需要去 .gradle 文件夹,如果你使用的 windows 它通常位于 USER/%USERNAME%/.gradle ,并创建一个全局 gradle.properties 然后添加以下内容。

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

这将重定向所有 gradle 连接抛出您的代理,例如 psiphone。


推荐阅读