android - com.android.ide.common.process.ProcessException : Failed to execute aapt

标签 android eclipse android-gradle-plugin

我将 eclipse android 项目迁移到具有 targetSdkVersion 19 的 android studio。现在,我将targetSdkVersion 更改为 23。现在问题是 Gradle 显示错误在将 com.android.support:appcompat-v7:23.0.1 添加到依赖项中之后。

Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:assembleDebug]
C:\Users\madhanhere\stories-android\app\build\intermediates\res\merged\debug\values\values.xml
Error:(190) Attribute "theme" has already been defined
Error:(190) Attribute "theme" has already been defined
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Information:BUILD FAILED

我的 app.gradle 文件:

应用插件:'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "21.0.1"
    useLibrary  'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.ebooks.stories"
        minSdkVersion 18
        targetSdkVersion 23
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile files('libs/core.jar')
    compile files('libs/logentries-android-2.1.2.jar')
    compile files('libs/picasso-2.2.0.jar')
    compile 'com.google.android.gms:play-services:5.+'
    compile 'com.facebook.android:facebook-android-sdk:3.+'
    compile 'com.android.support:appcompat-v7:23.0.1'
}

values.xml 文件:

<declare-styleable name="WalletFragmentOptions"><attr format="enum" name="theme">
            <enum name="holo_dark" value="0"/>
            <enum name="holo_light" value="1"/>
        </attr><attr format="enum" name="environment">
            <enum name="production" value="1"/>
            <enum name="sandbox" value="0"/>
            <enum name="strict_sandbox" value="2"/>
        </attr><attr format="reference" name="fragmentStyle"/><attr format="enum" name="fragmentMode">
            <enum name="buyButton" value="1"/>
            <enum name="selectionDetails" value="2"/>
        </attr></declare-styleable>

我该如何解决这个问题?

最佳答案

我忘记更新 play-services versionbuildToolsVersion。我通过将更新 play-serivces 更改为

解决了这个问题
com.google.android.gms:play-services:6.1.+

buildToolsVersion

buildToolsVersion "23.0.3"

关于android - com.android.ide.common.process.ProcessException : Failed to execute aapt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39970969/

相关文章:

android RelativeLayout,等间距?

Android 应用程序在调试中工作,但在发布时不工作

android - Android HttpURLConnection.setChunkedStreamingMode() 的默认 block 长度?

android - 模拟器 qemu : could not load initrd ' ' while trying to run android emulator

eclipse - 如何让 Logback 在 Eclipse 控制台中以红色记录 stderr?

java - Eclipse jar 导出和 lib 文件夹

android - 什么被视为 "decoupled project"(Gradle)?

java - 依赖项未复制到 jar 中(在 Gradle 中)

Android - 如何使用 uri 源在 VideoView 上设置缩略图?

java - 无法安装android-sdk : "java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema"