React Native移除代理

3

我有一个问题需要解决:无法取消代理设置。我已经尽可能地将代理服务器信息从所有可想到的地方移除。

以下是我收到的错误信息:

$ 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 

我该如何解决这个错误?

1个回答

6

尝试通过删除所有内容来解决它

systemProp.http.proxyHost
systemProp.http.proxyPort

systemProp.https.proxyHost
systemProp.https.proxyPort

C:/Users/[你的用户名]/.gradle/gradle.properties 文件中


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接