2016-04-27 19 views
2

當我在Android Studio中打開ARSimpleProj並嘗試更新版本的Gradle我得到這個消息:的ARToolKit ARSimpleProj錯誤

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和依賴關係標記(如AS_Migration文檔中所示),但仍然無效。

回答

1

我終於使它的工作。在Android Studio上打開項目時,我會選擇「稍後提醒我」來獲取Android Gradle插件更新建議。之後,我可以在我的手機上執行並安裝應用程序。

1

確保您在Project Structure中使用JDK 1.7。當使用帶有ARToolkit for Android的JDK 1.8時,我遇到了問題。