Android Studio 2.3.1中的Gradle Project Sync失败 [英] Gradle Project Sync failed in Android Studio 2.3.1

查看:621
本文介绍了Android Studio 2.3.1中的Gradle Project Sync失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在不正确关机后重新开启Android Studio后,我的gradle项目同步失败,并且很多错误如:无法解析:junit:junit:4.12开始显示在事件日志中。截图如下。





我试过以下的东西无济于事:


  • 更新了Android Studio到版本2.3。 1,因此也是Gradle

  • 我也有错误Plugin Error:required pluginxyzis disabled因此我取消选择所有显示设置错误的插件并重新选择它们,错误。

  • 然后我去了Files - >无效缓存/重新启动



更新:点击禁用离线模式和同步项目后,这就是发生了什么。



>







Gradle处于离线模式,这意味着它不会进入网络来解决依赖关系。



转到Preferen ces> Gradle并取消选中离线工作。

之后,尝试清理项目并重新运行


Upon reopening Android Studio after an improper shutdown, my gradle project sync failed and many errors like: "Failed to resolve: junit:junit:4.12" started showing up in the Event Log. Screenshot is given below.

I tried the following things to no avail:

  • Updated Android Studio to ver 2.3.1 and thus also the Gradle
  • I also had error for "Plugin Error: required plugin "xyz" is disabled" so i deselected all the plugins showing errors from settings and reselected them which removed the error.
  • Then i went to Files -> Invalidate caches/restart

What should i do?

UPDATE: After clicking on "Disable offline mode and sync project", this is what happened.


解决方案

From your first screenshot

Gradle is in offline mode, which means that it won't go to the network to resolve dependencies.

Go to Preferences > Gradle and uncheck "Offline work".

After that try cleaning the project and Re-running again?

这篇关于Android Studio 2.3.1中的Gradle Project Sync失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆