有人能帮我解决这个问题吗?我想在我的android studio项目中使用这个库
https://github.com/daimajia/AndroidImageSliderput当我把它放到gradle文件中时,它显示以下错误
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:1.0.1@aar'
compile fileTree(dir: 'libs', include: ['*.jar'])
}发布于 2014-06-13 16:36:06
我是this library的作者。我很抱歉给你带来了麻烦。
有一个解决方案你可以试一试:
将ic_launcher重命名为(在您的项目中为res/drawable-hdpi,res/drawable-mdpi,res/drawable-xhdpi,res/drawable-xxhdpi )。
仅当有两个文件同名时,才会出现此问题。
发布于 2016-02-17 21:40:03
你应该清理并重新构建你的项目。为此,您需要使Android Studio无效,然后重新启动。
检查下面的图像。

发布于 2020-12-01 12:05:37
可能文件已被模拟器锁定,请重新启动模拟器和IDE。
https://stackoverflow.com/questions/24140030
复制相似问题