Could not find method android() for arguments when building Android project from gradle

来源:互联网 发布:伯俊软件 编辑:程序博客网 时间:2024/05/01 22:19

https://stackoverflow.com/questions/26243480/could-not-find-method-android-for-arguments-when-building-android-project-from


The proposed solution is:

...in the root project's build.gradle:

ext {  compileSdkVersion = 19  buildToolsVersion = "19.0.1"}

in all the android modules:

android {  compileSdkVersion rootProject.ext.compileSdkVersion  buildToolsVersion rootProject.ext.buildToolsVersion}

...

One think I noticed was that this doesn't work on older versions of gradle (I was trying with 1.10 and got an error). With Gradle 2.1 this seems to work correctly though.


阅读全文
0 0