任何機構可以plz幫助他這個問題,我想,當我把它放在我的gradle這個文件中使用這個庫在我的Android Studio項目資源進入ic_launcher已經定義
https://github.com/daimajia/AndroidImageSlider
放它顯示了這些錯誤
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,但我不認爲這是一個問題?
這裏是我的build.gradle代碼
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'com.daimajia.slider:library:[email protected]'
compile fileTree(dir: 'libs', include: ['*.jar'])
}
呃,不,你需要從下載整個項目樹[https://github.com/daimajia/AndroidImageSlider](https://github.com/daimajia/AndroidImageSlider),包括其資源文件? – ChuongPham
即時消息不下載它我已經把build.gradle中的代碼行看到上面更新的問題 –
所有你正在做的是在構建腳本中包括相關的JAR。那資源文件呢?這就是你遇到錯誤的原因。您需要在某個地方下載項目,然後將整個項目包括到您的項目中。沒有資源文件,Gradle會抱怨。 – ChuongPham