2014-06-10 2 views
7

할 수있는 내가 내 Gradle을 파일에 넣을 때 이러한 오류를 보여줍니다 내 안드로이드 스튜디오 프로젝트에자원 항목 ic_launcher는 이미 정의

https://github.com/daimajia/AndroidImageSlider 

넣어이 라이브러리를 사용하려면이 문제를 어떤 신체 PLZ 도움말 그는

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 -I C:\Users\Razi\AppData\Local\Android\android-studio\sdk\platforms\android-19\android.jar -M C:\Users\Razi\AndroidStudioProjects\AllahNames\app\build\manifests\debug\AndroidManifest.xml -S C:\Users\Razi\AndroidStudioProjects\AllahNames\app\build\res\all\debug -A C:\Users\Razi\AndroidStudioProjects\AllahNames\app\build\assets\debug -m -J C:\Users\Razi\AndroidStudioProjects\AllahNames\app\build\source\r\debug -F C:\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가 이미 정의되었습니다. 무엇이 오류가 될 수 있습니까? 빌드 도구를 19.1.0으로 변경하려고했지만 문제가 아닌 것 같습니까?

는 여기에 내가 this library의 저자 해요 내 build.gradle 코드

dependencies { 
    compile 'com.android.support:appcompat-v7:+' 
    compile 'com.daimajia.slider:library:[email protected]' 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
} 
+0

어, 당신은에서 전체 프로젝트 트리를 다운로드 할 필요가 없습니다 [https://github.com/daimajia/AndroidImageSlider](https://github.com/daimajia/AndroidImageSlider) 포함 그것의 리소스 파일? – ChuongPham

+0

메신저를 다운로드하지 않았습니다. build.gradle에 코드 줄을 넣었습니다. 위의 업데이트 된 질문을 참조하십시오. –

+0

빌드 스크립트에 관련 JAR을 포함하면됩니다. 리소스 파일은 어떻습니까? 그래서 오류가 발생합니다. 프로젝트를 어딘가에 다운로드 한 다음 전체 프로젝트를 프로젝트에 포함시켜야합니다. 리소스 파일이 없으면 Gradle이 불평 할 것입니다. – ChuongPham

답변

11

입니다. 나는 너를이 곤경에 빠지게해서 미안해.

이 이름을 변경하려면 ic_launcher (프로젝트 res/drawable-hdpi, res/drawable-mdpi, res/drawable-xhdpi, res/drawable-xxhdpi에서) :

당신이 시도 할 수있는 솔루션이있다.

두 파일의 이름이 같은 경우에만이 문제가 발생합니다.

+0

이 문제를 해결 한 새로운 버전을 출시했습니다. https://github.com/daimajia/AndroidImageSlider/issues/8 – daimajia

+0

이 문제를 해결하기 위해 [v1.0.3] (https://github.com/daimajia/AndroidImageSlider/releases)을 배포했습니다. – daimajia

+0

참으로 나는 ic_launcher 파일의 이름을 바꾸어서 같은 날 그것을 고쳤지 만 내 자신의 ic_launcher를 어떻게 넣을 지 궁금했지만 지금 고칠 수있어 감사합니다 ... 답장을 보내 주셔서 감사합니다! –

0

프로젝트를 정리하고 다시 빌드해야합니다. 그렇게하려면 Android Studio를 무효화 한 다음 다시 시작해야합니다.

아래 이미지를 확인하십시오.

enter image description here