问题描述
我刚刚更新到适用于Mac的Android Studio 2.2.1。然后我将JDK更新到版本8.尝试启动一个新项目并运行它。我收到以下错误:
I just updated to Android Studio 2.2.1 for Mac. Then I updated the JDK to version 8. Tried to start a new project and run it. I got the following error:
错误:(1,1)评估项目':app'时出现问题。
Error:(1, 1) A problem occurred evaluating project ':app'.
我也尝试回到JDK版本7,因为它在谷歌网站上说JDK 8对Mac不稳定。仍然有同样的错误。
I also tried going back to JDK version 7 as it says on google site that JDK 8 is unstable for Mac. still got the same error.
推荐答案
检查你的android构建工具依赖项。在你的build.gradle中,如下所示:
Check your android build tools dependencies. In your build.gradle if its something like:
classpath "com.android.tools.build:gradle:+"
它可能已经下载了2.2的alpha值,这可能会导致你看到的错误。
It has likely downloaded the alpha of 2.2 and that can cause the error you are seeing.
尝试
classpath "com.android.tools.build:gradle:2.1.0"
如果您已经使用了正确的构建工具版本但仍然收到此错误,可能是其中一个您使用的第三方Android库由于相同的原因导致问题。您可以通过更改
If you are already using the right build tools version but keep getting this error, maybe one of the third party Android libraries you are using is causing the problem due to the same reason. You can force the dependency version to be used (including transitive) by changing
classpath "com.android.tools.build:gradle:2.1.0"
到
classpath('com.android.tools.build:gradle:2.1.0') {
force = true
}
文档:和。
这篇关于尝试在Android Studio 2.2.1中运行新项目时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!