gpt4 book ai didi

android - 资源条目 ic_launcher 已定义

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:21:32 24 4
gpt4 key购买 nike

任何人都可以帮助他解决这个问题我想在我的 android studio 项目上使用这个库

https://github.com/daimajia/AndroidImageSlider

当我将它放入我的 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'])
}

最佳答案

我是 this library 的作者.很抱歉给你添麻烦。

有一个解决方案你可以试试:

重命名 ic_launcher(在您的项目中 res/drawable-hdpires/drawable-mdpires/drawable- xhdpi, res/drawable-xxhdpi ).

只有当有两个同名文件时才会出现此问题。

关于android - 资源条目 ic_launcher 已定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24140030/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com