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

问题描述

我注意到有几个人在升级到 Android Studio 0.4.3 后遇到了问题(我相信 0.4.2 也有问题).到目前为止,我的错误和调试步骤如下:

I have noticed that several people are having issues after upgrading to Android Studio 0.4.3 (problem with 0.4.2 also I believe). My error and debug steps so far are as follows:

我看到的消息是Gradle 项目同步失败.基本功能(例如编辑、调试)将无法正常工作",如下面的快照所示.

The message I see is "Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly" as shown in snapshot below.

我找到了这个主题并遵循了说明,但我仍然有错误.我无法在线程中执行以下指令:我进入 Gradle 设置并单击使用本地 Gradle 分发版"并将其指向*:C:/Users/robot_000/.gradle/wrapper/dists/gradle-1.10-all/6vpvhqu0efs1fqmqr2decq1v12/gradle-1.10

I found this thread and following instructions, but I still have the error. I am not able to do the following instruction in the thread:I went into Gradle settings and clicked on "use local Gradle distribution" and pointed it to*:C:/Users/robot_000/.gradle/wrapper/dists/gradle-1.10-all/6vpvhqu0efs1fqmqr2decq1v12/gradle-1.10

我需要本地分发 gradle 吗?我从哪里下载它,我把它放在哪里?我现在如何告诉 Android Studio 使用它?(如您所知,我不明白 gradle 是如何工作的).感谢您的帮助.

Do I need to have a local distribution of gradle? Where do I download it from and where do i put it? How do I now tell Android Studio to use it? (as you can tell, I don't understand how gradle works). Thanks for any help.

更新 1:我在 C:\Users\home.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10 的计算机上找到了 gradle 文件,但是我该怎么做:进入 Gradle 设置并单击使用本地 Gradle 发行版"并将其指向*"(根据 THIS THREAD)

Update 1:I found the gradle files on my computer at C:\Users\home.gradle\wrapper\dists\gradle-1.10-all\6vpvhqu0efs1fqmqr2decq1v12\gradle-1.10, but how do I do do this: "went into Gradle settings and clicked on "use local Gradle distribution" and pointed it to*" (as per THIS THREAD)

推荐答案

转到文件">设置">Gradle",您将最终看到此屏幕以设置您的 gradle :

Go to File > Settings > Gradle you will end up with this screen for setting up your gradle :

还要确保您的 Android SDK 目录中有 Google 存储库,该目录位于:

Also make sure you have Google Repository in your Android SDK directory which will be located at :

$SDK_DIR\extras\google\m2repository\com\google\android\gms\play-services\3.1.36

如果没有,请先从 SDK Manager > Extras > Google Repository 安装.

If not do install it from SDK Manager > Extras > Google Repository first.

你所有的build.gradle(如果你使用根级build.gradle来定义android gradle插件版本,只签入)必须指向0.8 android gradle 插件版本(目前最新)

All your build.gradle(If you are using root level build.gradle to define android gradle plugin version, check in that only) must point to 0.8 version(latest as of now) of android gradle plugin

 dependencies {
     classpath 'com.android.tools.build:gradle:0.8.+'
 }

更新:

映射是:

 | Android Gradle Plugin |  Gradle Version |
       0.7.+                     1.9
       0.8.+                     1.10

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

10-31 16:23