questionasker
questionasker

Reputation: 2697

Android - Building error after enable firebase cloud in project structure

My Project build successfully before i checked Firebase Cloud in Android Studio's Project Structure. The Error i get after enable it :

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:Execution failed for task ':processFlavorDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/me212/Library/Android/sdk/build-tools/23.0.3/aapt'' finished with non-zero exit value 1

I have unchecked the firebase cloud, but it not resolved.

Below are my Build.Gradle, i have Up/Down Grade the buildTools version but still no luck :

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

allprojects {
    repositories {
        mavenCentral()
    }
}


apply plugin: 'com.android.application'



dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    //    compile 'com.google.android.gms:play-services:8.3.0'
    //    compile 'com.google.android.gms:play-services-appstate:8.3.0'
    compile project(':baseGameUtils')
    compile project(':andEngine')
    compile project(':andEngineTMXTiledMapExtension')
    compile project(':andEngineDebugDrawExtension')
    compile project(':unity-ads')

    compile 'com.android.support:multidex:1.0.0'
    compile 'com.google.android.gms:play-services-plus:9.4.0'
    compile 'com.google.android.gms:play-services-auth:9.4.0'
    compile 'com.google.android.gms:play-services-ads:9.4.0'
    compile 'com.google.android.gms:play-services-games:9.4.0'
    compile 'com.android.support:appcompat-v7:24.1.1'
    compile 'com.facebook.android:facebook-android-sdk:4.7.0'
    compile 'com.google.android.gms:play-services-analytics:9.4.0'
    compile 'com.google.firebase:firebase-core:9.4.0'
    compile 'com.google.firebase:firebase-messaging:9.4.0'
}

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

android {
    compileSdkVersion 21
    buildToolsVersion "23"

    buildTypes {
        release {
            minifyEnabled true
            proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
        }
    }

    productFlavors {
        flavor {
            proguardFile 'proguard-project.txt'
            applicationId 'com.myapps'
        }
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 21
        // Enabling multidex support.
        multiDexEnabled true
        applicationId 'com.myappsDebug'
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src', 'src/main/resources', 'src/main/resources/jniLibs']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }
}

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

Any Idea ?

Upvotes: 0

Views: 275

Answers (2)

Amad Yus
Amad Yus

Reputation: 2866

You're using com.android.support:appcompat-v7:24.1.1 (Use this version if you're supporting Android N) but your compileSdkVersion is 21 which is wrong. If you want to use latest version of support library, you also need to increase your target sdk version. Try change compileSdkVersion and targetSdkVersion to 24.

For your information, android sdk 24 is for Android N (Nougat). If you're not targeting this android version, please downgrade your support library to com.android.support:support-v4:23.4.0 and change compileSdkVersion and targetSdkVersion to 23.

Upvotes: 1

user3956566
user3956566

Reputation:

Match your build tool version to your sdk

classpath 'com.android.tools.build:gradle:2.1.2'

buildToolsVersion "23"

targetSdkVersion 21

So change to:

buildToolsVersion "23"

Also, don't downgrade the target sdk to match the tools, upgrade the tools to match the target sdk.

Upvotes: 1

Related Questions