6

今天我将 Android Studio 从 3.0.1 更新到 3.1。

我在使用 Gradle 时遇到了一个奇怪的问题。每次我尝试编辑 .gradle 文件时,Android Studio 都会冻结。

通过一些研究,我发现每次编辑 .gradle 文件时,Android Studio 都会发送一个搜索请求“ http://search.maven.org/ ”。

我在工作中使用代理,一切都已配置,在更新之前一切正常。

有人在这个版本或旧版本遇到过同样的问题吗?

4

3 回答 3

3

jcenter 存在问题,因此当您正确构建项目时,一旦启用离线模式,AS 就不必在每次 gradle 刷新时都连接到 jcenter。

有关更多信息,请参阅此问题

于 2018-03-27T16:58:14.157 回答
2

检查idea.log以查看是否有任何错误总是好的。在 Mac OS X 上,您可以使用“帮助”>“在 Finder 中显示日志”来显示 idea.log 文件。

就我而言,我在下面发现了错误,因为我刚刚更改了密码,所以我的代理失败了。更新密码后,冻结问题消失了。

WARN - roid.inspections.LintIdeClient - Could not connect to maven central to look up the latest available version for com.google.android:flexbox:+
WARN - roid.inspections.LintIdeClient - Could not connect to maven central to look up the latest available version for com.google.android:flexbox:+
于 2018-04-05T05:29:49.490 回答
0

使用以下更新build.gradle中的 maven gradle 插件

classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

gradle-wrapper.properties 中使用:

distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip

并将 buildToolsVersion 更新27.0.3

于 2018-03-29T10:45:15.087 回答