问题
I'm trying to add a splash.png image but when I compile it says this:
Error:error: Resource entry splash is already defined.
res\drawable-hdpi-v4\splash.jpg:0: Originally defined here.
Error:error: Resource entry splash is already defined.
res\drawable-xhdpi-v4\splash.jpg:0: Originally defined here.
Error:error: Resource entry splash is already defined.
res\drawable-xxhdpi-v4\splash.jpg:0: Originally defined here.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Users\German\AppData\Local\Android\android-sdk\build-tools\19.1.0\aapt.exe package -f --no- crunch -I C:\Users\German\AppData\Local\Android\android-sdk\platforms\android-12\android.jar -M C:\Users\German\AndroidStudioProjects\BASEUNODISCO\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Users\German\AndroidStudioProjects\BASEUNODISCO\app\build\intermediates\res\debug -A C:\Users\German\AndroidStudioProjects\BASEUNODISCO\app\build\intermediates\assets\debug -m -J C:\Users\German\AndroidStudioProjects\BASEUNODISCO\app\build\generated\source\r\debug -F C:\Users\German\AndroidStudioProjects\BASEUNODISCO\app\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package disepro.baseunodisco -0 apk --output-text-symbols C:\Users\German\AndroidStudioProjects\BASEUNODISCO\app\build\intermediates\symbols\debug
Error Code:
1
Output:
res\drawable-hdpi-v4\splash.png:0: error: Resource entry splash is already defined.
res\drawable-hdpi-v4\splash.jpg:0: Originally defined here.
res\drawable-xhdpi-v4\splash.png:0: error: Resource entry splash is already defined.
res\drawable-xhdpi-v4\splash.jpg:0: Originally defined here.
res\drawable-xxhdpi-v4\splash.png:0: error: Resource entry splash is already defined.
res\drawable-xxhdpi-v4\splash.jpg:0: Originally defined here.
The thing is that I don't have any splash.jpg in my files!! I once put one splash.jpg but I 've already delete it
Please help! It's getting me nervous
回答1:
Did you tried to clean your project?
menu -> project -> clean
回答2:
The problem is that you can´t have the same file name inside your drawable
folder:
res\drawable-hdpi-v4\splash.png:0: error: Resource entry splash is already defined.
res\drawable-hdpi-v4\splash.jpg:0: Originally defined here.
must have only a .png
or .jpg
file
delete repeated files and clean your project: Project
-> Clean
回答3:
In Android Studio you can get rid of this error message by doing,
Build->Clean Project
回答4:
I was also having that issue. But with me, deleting bin folder and then clean and build project solved the issue. Actually duplicates files were in bin/res folder.
来源:https://stackoverflow.com/questions/27320120/resource-entry-is-already-defined