Resource ID ic_launcher already defined

can any plz body help him with this problem, i want to use this library in my android studio project.

https://github.com/daimajia/AndroidImageSlider 

when i put it in my gradle file it shows these errors

 Information:Gradle tasks [:app:generateDebugSources] Information:res\drawable-mdpi-v4\ic_launcher.png:0: error: Resource entry ic_launcher is already defined. Information:res\drawable-mdpi\ic_launcher.png:0: Originally defined here. Information:res\drawable-xhdpi-v4\ic_launcher.png:0: error: Resource entry ic_launcher is already defined. Information:res\drawable-xhdpi\ic_launcher.png:0: Originally defined here. Information:res\drawable-xxhdpi-v4\ic_launcher.png:0: error: Resource entry ic_launcher is already defined. Information:res\drawable-xxhdpi\ic_launcher.png:0: Originally defined here. Information:1 error Information:0 warnings Information:See complete output in console Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\Razi\AppData\Local\Android\android-studio\sdk\build-tools\19.1.0\aapt.exe package -f --no-crunch -IC:\Users\Razi\AppData\Local\Android\android-studio\sdk\platforms\android-19\android.jar -MC:\Users\Razi\AndroidStudioProjects\AllahNames\app\build\manifests\debug\AndroidManifest.xml -SC:\Users\Razi\AndroidStudioProjects\AllahNames\app\build\res\all\debug -AC:\Users\Razi\AndroidStudioProjects\AllahNames\app\build\assets\debug -m -JC:\Users\Razi\AndroidStudioProjects\AllahNames\app\build\source\r\debug -FC:\Users\Razi\AndroidStudioProjects\AllahNames\app\build\libs\app-debug.ap_ --debug-mode --custom-package com.ua.allahnames.app --output-text-symbols C:\Users\Razi\AndroidStudioProjects\AllahNames\app\build\symbols\debug Error Code: 1 Output: res\drawable-mdpi-v4\ic_launcher.png:0: error: Resource entry ic_launcher is already defined. res\drawable-mdpi\ic_launcher.png:0: Originally defined here. res\drawable-xhdpi-v4\ic_launcher.png:0: error: Resource entry ic_launcher is already defined. res\drawable-xhdpi\ic_launcher.png:0: Originally defined here. res\drawable-xxhdpi-v4\ic_launcher.png:0: error: Resource entry ic_launcher is already defined. res\drawable-xxhdpi\ic_launcher.png:0: Originally defined here. 

ic_launcher is already defined! What could be a mistake? I tried changing the build tools to 19.1.0, but I don’t think this is a problem?

here is my build.gradle code

 dependencies { compile 'com.android.support:appcompat-v7:+' compile 'com.daimajia.slider:library: 1.0.1@aar ' compile fileTree(dir: 'libs', include: ['*.jar']) } 
+7
android android gradle
source share
2 answers

I am the author of this library . I'm sorry that you got into this trouble.

There is a solution that you can try:

rename ic_launcher (in your project res/drawable-hdpi , res/drawable-mdpi , res/drawable-xhdpi , res/drawable-xxhdpi ).

This problem occurs when two files have the same name.

+11
source share

You must clean and rebuild your project. To do this, you need to cancel and then restart Android Studio.

Check out the image below.

enter image description here

0
source share

All Articles