I create a simple project in AndroidStudio with a few modules. Each module\'s gradle script contains the following code:
android {
compileSdkVersion 18
Simply referencing 'android' closure from top level build doesn't work if top level build is not an android build. The 'android' method is not available until after evaluate. Originally, I had a working solution based on setting the config afterEvaluate but it no longer works (Android Studio 0.6.0):
Android tasks have already been created. This happens when calling android.applicationVariants, android.libraryVariants or android.testVariants. Once these methods are called, it is not possible to continue configuring the model.