I want to build aab to upload CH Play but it always fails and shows a message:
Execution failed for task ':app:packageReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> File 'root/res/drawable-hdpi/ic_launcher.png' uses reserved file or directory name 'res'.
I tried to search ic_launcher.png but my app does not use that name.
Note: I added ‘ic_launcher.png’ in the folder drawable but it still errors.
Please help me with this issue. Thanks in advance!
2
Answers
‘res’ is android application reserved directory name, try to change ‘root/res’ for another name
I suspect you depend on a
jar
which should be anaar
.Jars don’t have the concept of Android resources, so when the app bundle is built, it would consider the "res" directory as a a regular directory that would thus be packaged under "root".
Resources can be packaged in
aar
files, which would then be packaged properly.