本文介绍了Android Studio 2.2.3:Gradle项目同步失败.基本功能(例如,编辑,调试)将无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要预装笔记本电脑并切换到Windows 10.在此之前,我在Android Studio 2.2.3中制作并保存了项目,并在预安装后下载了相同版本的Android Studio,但是当我选择打开现有项目"时,我收到以下消息:

I needed to preinstall my laptop and switched to Windows 10 . Before that I made and saved my project in Android Studio 2.2.3 and I downloaded the same version of Android Studio after preinstallation, but when I choose Open Existing Project I got the following message:

此意外错误的可能原因包括:Gradle的依赖性 缓存可能已损坏(网络连接后有时会发生这种情况 超时.)

Possible causes for this unexpected error include: Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Gradle构建过程(守护程序)的状态可能已损坏.停止中 所有Gradle守护程序都可以解决此问题.

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

您的项目可能正在使用不兼容的第三方插件 与项目中的其他插件或Gradle版本一起使用 根据项目要求. 引用

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project. Blockquote

我完成了Android Studio建议的所有三个步骤来修复我的项目,但没有一个起作用.

I did all the three steps suggested by Android Studio to fix my project, but none of them worked.

推荐答案

您的gradle版本是:1.8,该版本不再起作用,因此您可能必须对其进行更新:

Your gradle version is: 1.8 which is not working anymore so you probably have to update it:

1-转到-> https://gradle.org/install 查看最新的版本号.

1- Go to -> https://gradle.org/installcheck out the latest verion number.

2-在项目目录中,导航到\gradle\wrapper\目录并gradle-wrapper.properties文件.

2- In your project directory navigate to \gradle\wrapper\ directory and edit: gradle-wrapper.properties file.

更改:

https://services.gradle.org/distributions/gradle-1.8-all.zip

收件人:

https://services.gradle.org/distributions/gradle-3.3-all.zip

3-转到工具→Android→使用Gradle文件同步项目

3- go to Tools→Android→Sync Project with Gradle files

4-如果同步未完成,请重新启动Android Studio

4- If sync doesn't do the job restart Android studio

这篇关于Android Studio 2.2.3:Gradle项目同步失败.基本功能(例如,编辑,调试)将无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 23:10