2

Please do not tag this question as duplicate... I did not manage to find a solution on the other posts, especially this one... :(

I have got the following error when I launch my app:

/build/intermediates/res/merged/debug/values-v23/values-v23.xml
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(34) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(34) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

Here is my Gradle at the app level:

android {
    compileSdkVersion 22 
    buildToolsVersion '25.0.2' 
    useLibrary  'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.tasmanic.radio.fm"
        minSdkVersion 14 
        targetSdkVersion 22
    }

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

dependencies {

    compile 'com.android.support:support-v4:22.2.1' 
compile 'com.android.support:support-v4:22.2.1'
    compile 'com.android.support:animated-vector-drawable:22.2.1'
    compile 'com.android.support:appcompat-v7:22.2.1'

    compile files('libs/libGoogleAnalyticsServices.jar')

    compile 'com.google.android.gms:play-services-analytics:10.2.1' 
    compile 'com.google.android.gms:play-services-ads:10.2.1'

    compile 'com.google.firebase:firebase-core:10.2.1'
    compile 'com.google.firebase:firebase-messaging:10.2.1'
    compile 'com.google.firebase:firebase-config:10.2.1'


    compile 'com.android.support:recyclerview-v7:22.2.1'
    compile fileTree(dir: 'libs', include: ['*.jar'])


}

apply plugin: 'com.google.gms.google-services'

At the project level:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.1' 
        classpath 'com.google.gms:google-services:3.0.0'

    }
}

Note that I want to keep targetSdkVersion equal to 22.

Any idea on how to solve this issue?

Thanks !!!

Community
  • 1
  • 1
toto_tata
  • 14,526
  • 27
  • 108
  • 198
  • If you see the log, the error is in a folder for v23 and you are targeting to v22. If you delete this folder may be it works. – ARP May 16 '17 at 17:20
  • have you used any values under resource folder for version 23 or higher ? Check res folder, if you found any folder or file contains v23 with its name try to remove it and build your project. – Pragnesh Ghoda シ May 16 '17 at 17:27

2 Answers2

2

Google Play services / Firebase 10.2.1 depends on version 24.0.0 of the Android Support Library, which you can see by running gradlew androidDependencies.

This means you must compile with API 24 or higher. That does not mean you have to target API 24 or higher though, as explained in this blog post.

The last version of Google Play services to depend on a v22 version of the Support Library was 8.4.0, which does not include any of the Firebase functionality (introduced in 10.0.0).

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443
0

try change Widget.Material to Theme.AppCompat in your styles-files, that match api level < 21

Gogi Bobina
  • 1,086
  • 1
  • 8
  • 25