In our library module, we have resource files that unfortunately have the same name as support library files: such as abc_list_focused_holo.9.png (It's not my decision and I am not allowed to rename it.)
Now, I am trying to add Goole Play Service. So I added
compile 'com.google.android.gms:play-services:7.5.0'
I got this error:
:Bad-Project:processReleaseResourcesC:\Bad-Project\build\intermediates\res\release\drawable-hdpi-v4\abc_list_focused_holo.9.png: error: Duplicate file.
C:\Bad-Project\build\intermediates\res\release\drawable-hdpi\abc_list_focused_holo.9.png: Original is here. The version qualifier may be implied.
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Bad-Project:processReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\xxx\AppData\Local\Android\sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1
I have tried adding
packagingOptions {
pickFirst 'res/drawable-hdpi-v4/abc_list_focused_holo.9.png'
pickFirst 'res/drawable-hdpi/abc_list_focused_holo.9.png'
}
And also
packagingOptions {
exclude 'res/drawable-hdpi-v4/abc_list_focused_holo.9.png'
exclude 'res/drawable-hdpi/abc_list_focused_holo.9.png'
}
However, they didn't work. I still have the same error. Any idea how can I fix this issue?
Thanks