How does Android Studio gradle plugin manage resource files (AndroidManifest.xml)? -
i have project's build.gradle located in myapp/app/ directory. androidmanifest.xml in myapp/app/src/main directory, @ same level java/ , res/ directories.
when synchronizing project, receive notification missing manifest file. no wonder, actually, when path incorrect. source file set as:
sourcesets { main { manifest.srcfile 'src/main/androidmanifest.xml' } } and error notification says:
error:cause: java.io.filenotfoundexception: /home/aqv/androidstudioprojects/myapp/src/main/androidmanifest.xml (no such file or directory)
when change source to:
sourcesets { main { manifest.srcfile 'main/androidmanifest.xml' } } the text changes to:
error:cause: java.io.filenotfoundexception: /home/aqv/androidstudioprojects/myapp/app/main/androidmanifest.xml (no such file or directory)
as can see, there missing path fragment: myapp/app/src/ (when setting src/main/androidmanifest.xml path, error says looking manifest file in myapp/src/main, ommits app/ directory).
is kind of gradle's bug or project misconfigured?
looking solution found 1 thread @ so, solution there didn't work in case. have dependencies set as:
compile 'com.android.support:support-v4:19.1.0' compile 'com.android.support:appcompat-v7:19.1.0'
writing answer since issue someone.
by default android studio creates multi module project. have build.gradle in root folder of project , build.gradle in app folder:
<your project name> /app /src build.gradle build.gradle settings.gradle the parent build.gradle edited if want specify default settings subprojects. looks odd since have 1 subproject now.
the topic starter issue was adding/modifying root build.gradle instead of app folder build.gradle.
Comments
Post a Comment