我在设置代理服务器设置时遇到问题。我已经删除了我想到的所有地方的代理。
这是我收到的错误:
$ react-native run-android
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Starting a Gradle Daemon (subsequent builds will be faster)
> Configure project :app
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
> Configure project :react-native-oauth
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.4.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.github.delight-im:Android-AdvancedWebView:v3.0.0.
Required by:
project :app > project :react-native-oauth
> Could not resolve com.github.delight-im:Android-AdvancedWebView:v3.0.0.
> Could not get resource 'https://jcenter.bintray.com/com/github/delight-im/Android-AdvancedWebView/v3.0.0/Android-AdvancedWebView-v3.0.0.pom'.
> Could not HEAD 'https://jcenter.bintray.com/com/github/delight-im/Android-AdvancedWebView/v3.0.0/Android-AdvancedWebView-v3.0.0.pom'.
> Connect to 172.31.1.4:8080 [/172.31.1.4] failed: connect timed out
* 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 2m 48s
9 actionable tasks: 1 executed, 8 up-to-date
我所做的事情如下:
$ npm config delete http-proxy
npm config delete https-proxy
npm config rm proxy
npm config rm https-proxy
我已通过/etc/environment
文件进行了检查。
选中android/gradle.properties
$ env | grep proxy
#outputs nothing
$ unset http_proxy https_proxy all_proxy HTTP_PROXY HTTPS_PROXY ALL_PROXY # Still did this for a local bash
在项目的根文件夹中,我使用以下命令搜索代理
:$ grep -iRl ./android -e "172.31.1.4"
#no output
如何解决此错误?
答案 0 :(得分:3)
尝试通过全部删除来解决
systemProp.http.proxyHost
systemProp.http.proxyPort
systemProp.https.proxyHost
systemProp.https.proxyPort
在 C:/ Users / [您的用户名] /。gradle / gradle.properties 文件中