I have a multi-project Android system for Android. The structure of the project is as follows:
Root Dir | settings.gradle | build.gradle | Apps | app 1 | build.gradle | app 2 | build.gradle | Libs | lib 1 | build.gradle | lib 2 | build.gradle
All applications and libraries share a common Android configuration.
At the Root build.gradle level, I have the following:
subprojects { apply plugin: 'android' android { compileSdkVersion "Google Inc.:Google APIs:19" buildToolsVersion "20.0.0" defaultConfig { minSdkVersion 14 targetSdkVersion 19 } } }
Next, I thought about adding the following to build.gradle in application 1
apply plugin: 'com.android.application' android { sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] res.srcDirs = ['res'] } } }
I get the following error:
Cannot add extension with name 'android', as there is an extension already registered with that name.
In the gradle plugin for android, is there a way to have a โmain android configurationโ that can be extended with a submodule?
source share