Haris Kovacevic
Haris Kovacevic

Reputation: 682

Android project won't build after updating SDK

Okey I updated SDK and before that my project was building and now I have bunch of errors :

/home/user/project/android-project/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v14/values.xml
Error:(17, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.
Error:(47, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(17, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
/home/user/Project/android-project/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.0.0/res/values-v11/values.xml
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'.
Error:(47, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(17, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.

And some are quite absurd like:

Error:Attribute "background" has already been defined

I checked file on which error points but I can't find attribute with that name.

Lastly I see two new folders generated under :

/ app / build / intermediates / exploded-aar /

appcompact-v7 and mediarouter-v7.

How can I disable their generation ? And is there anyway to revert this back ?

UPDATE

As Jasper wrote I just needed to set my targetSdk and compileSdk version to the latest.But still I have one problem.

It's Error:Attribute "background" has already been defined which points me to colors.xml

<resources>
    <color name="black">#000000</color>
    <color name="stats_font_color">#ffa326</color>
    <color name="dark_bg_a70">#b3000000</color>
    <color name="dark_bg_a77">#c4000000</color>
    <color name="gray_a90">#e6313131</color>
    <color name="white">#ffffffff</color>
    <color name="white_a50">#80ffffff</color>
    <color name="white_a35">#59ffffff</color>
    <color name="reminder_table_light">#757575</color>
    <color name="reminder_table_dark">#000000</color>
</resources>

Error that gradle generates

Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    /home/user/Android/Sdk/build-tools/22.0.0/aapt package -f --no-crunch -I /home/user/Android/Sdk/platforms/android-22/android.jar -M /home/user/Project/project/app/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /home/user/Project/project/app/build/intermediates/res/debug -A /home/user/Project/project/app/build/intermediates/assets/debug -m -J /home/user/Project/project/app/build/generated/source/r/debug -F /home/user/Project/project/app/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package com.projectname -0 apk --output-text-symbols /home/user/Project/project/app/build/intermediates/symbols/debug
  Error Code:
    1
  Output:
/app/build/intermediates/res/debug/values/values.xml:207: error: Attribute "background" has already been defined

My dependencies

dependencies {
    compile 'com.android.support:support-v4:22.0.0'
    compile 'com.google.code.gson:gson:2.2.4'
    compile 'com.google.android.gms:play-services:+'
    compile files('libs/android-async-http-sources.jar')
    compile files('libs/android-async-http.jar')
    compile files('libs/commons-lang-2.6-javadoc.jar')
    compile files('libs/commons-lang-2.6-sources.jar')
    compile files('libs/commons-lang-2.6.jar')
    compile files('libs/crashlytics.jar')
    compile files('libs/gesticulate.jar')
    compile files('libs/simple-xml-2.7.jar')
    compile files('libs/urlimageviewhelper-sources.jar')
    compile files('libs/urlimageviewhelper.jar')
}

Upvotes: 2

Views: 1156

Answers (1)

Jasper
Jasper

Reputation: 70

Have you tried to set build.gradle?

compileSdkVersion 22
buildToolsVersion "22.0.0"

targetSdkVersion 22

compile 'com.android.support:appcompat-v7:22.0.+'

Upvotes: 2

Related Questions