当我在Android Studio中打开ARSimpleProj并尝试更新gradle版本时,我收到以下消息:
Failed to update the version of the Android Gradle plugin.
Please click 'OK' to perform a textual search and then update the build files manually.在这之后,我得到了这个错误:
Error:(58, 0) Gradle DSL method not found: 'android()'
Possible causes:
* The project 'ARSimpleProj' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0). Fix plugin version and sync project
* The project 'ARSimpleProj' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file
* The build file may be missing a Gradle plugin. Apply Gradle plugin.我尝试从顶层的build.gradle文件中删除android->buildToolsVersion和dependencies标记(如AS_Migration文档中所示),但仍然不起作用。
发布于 2016-04-27 11:23:35
我终于让它工作了。当在Android Studio上打开这个项目时,我选择了Android Gradle插件更新推荐中的“稍后提醒我”。在此之后,我可以在我的手机上执行和安装应用程序。
发布于 2016-04-27 11:25:32
确保您在Project Structure中使用JDK 1.7。我在使用安卓ARToolkit版的JDK 1.8时遇到了一些问题。
https://stackoverflow.com/questions/36879613
复制相似问题