The default project structure has changed, so if you donβt tell the Gradle plugin where to find your manifest (and the rest of your code) or switch to the new structure, the Gradle plugin will look wrong place.
In your case, it looks for the manifest in \src\main\AndroidManifest.xml
, which is used by default for new Gradle projects. The old project structure (used by Eclipse + ADT) places the manifest at the root of your project in \AndroidManifest.xml
.
You can specify an alternate location in your build.gradle using closing sourceSets
, for example:
android { // ... sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] aidl.srcDirs = ['src'] renderscript.srcDirs = ['src'] res.srcDirs = ['res'] assets.srcDirs = ['assets'] } debug.setRoot('build-types/debug') release.setRoot('build-types/release') }
This will allow you to configure the Android Gradle plugin to use the old project structure for your manifest, Java sources, and resources.
If you are using the Android Studio import tool, it should take care of all this for you.
source share