gpt4 book ai didi

java - 安卓工作室 : Error Code 1: Gradle: Execution failed for task ':app:processDebugResources'

转载 作者:搜寻专家 更新时间:2023-10-30 19:41:35 26 4
gpt4 key购买 nike

我想编译一个项目,我得到了 Error:Gradle: Execution failed for task ':app:processDebugResources'。

这里是个异常(exception):

Error:Gradle: Execution failed for task ':app:processDebugResources'. com.android.ide.common.internal.LoggedErrorException: Failed to run command:

D:\devtools\adt\sdk\build-tools\21.1.1\aapt.exe package -f --no-crunch -I D:\devtools\adt\sdk\platforms\android-21\android.jar -M E:\code\android\TVMediaPlayer\app\build\manifests\debug\AndroidManifest.xml -S E:\code\android\TVMediaPlayer\app\build\res\all\debug -A E:\code\android\TVMediaPlayer\app\build\assets\debug -m -J E:\code\android\TVMediaPlayer\app\build\source\r\debug -F E:\code\android\TVMediaPlayer\app\build\libs\app-debug.ap_ --debug-mode --custom-package com.skyworth.tvmediaplayer.app --output-text-symbols E:\code\android\TVMediaPlayer\app\build\symbols\debug

Error Code: 1

Output: E:\code\android\TVMediaPlayer\app\build\res\all\debug\drawable-hdpi-v4\ic_launcher.png: error: Duplicate file. E:\code\android\TVMediaPlayer\app\build\res\all\debug\drawable-hdpi\ic_launcher.png: Original is here. The version qualifier may be implied.

这是gradle文件:

    android {
compileSdkVersion 21
buildToolsVersion "21.0.2"

defaultConfig {
applicationId "com.jerrellmardis.amphitheatre"
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
renderscriptTargetApi 19

buildConfigField "String", "TMDB_API_KEY", "\"${loadSecret("TMDB_API_KEY")}\""
}
......
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.android.support:leanback-v17:21.0.0'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:palette-v7:21.0.0'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'com.squareup.retrofit:retrofit:1.7.1'
compile 'com.google.code.gson:gson:2.3'
compile 'org.apache.commons:commons-lang3:3.3.2'
compile 'org.apache.commons:commons-collections4:4.0'
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.github.satyan:sugar:1.3'
}

我对错误信息感到困惑,我放错了png文件还是我的gradle配置文件有误?

最佳答案

我在使用第三方库时遇到了同样的问题。

为了解决这个问题,我将 ic_launcher.png 文件从 drawable 文件夹移到了 mipmap 文件夹。问题解决了。

enter image description here

关于java - 安卓工作室 : Error Code 1: Gradle: Execution failed for task ':app:processDebugResources' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27402048/

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