Android相关

Gradle build报错Enable Gradle 'off

2019-12-05  本文已影响0人  jqboooo

1、新安装Android Studio构建项目时,报错如下信息:

Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.2/gradle-3.5.2.pom'. 
Received status code 400 from server: Bad Request
<a href="toggle.offline.mode">Enable Gradle 'offline mode' and sync project</a> 

2、解决办法

原因是由于在启动时,需要配置代理,然后在gradle.properties配置文件中会自动添加以下代理IP及port

只要将以下的配置文件的最下面4行删除,即可解决问题。

C:\Users***.gradle\gradle.properties

## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Thu Dec 05 09:52:00 CST 2019
systemProp.https.proxyPort=80
systemProp.http.proxyHost=mirrors.neusoft.edu.cn
systemProp.https.proxyHost=mirrors.neusoft.edu.cn
systemProp.http.proxyPort=80

由于重新整系统,然后重新安装AS工具,然后碰到这问题,做记录下。

上一篇下一篇

猜你喜欢

热点阅读