madhan kumar madhan kumar - 28 days ago 11
Android Question

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

I'm have migrated eclipse android project to android studio which has the

targetSdkVersion
19. Now, I'm changed
targetSdkVersion
to 23. Now the problem is Gradle shows error after adding
com.android.support:appcompat-v7:23.0.1
into dependencies.

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


My app.gradle file:

apply plugin: '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 file:

<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>


How can I solve this any solution?

Answer

I have forget to update play-services version and buildToolsVersion. I solved the problem by changing updating play-serivces to com.google.android.gms:play-services:6.1.+ and buildToolsVersion "23.0.3".