应用程序兼容错误。我已经为 google 地图更改了 API 21。但是还是有一些错误

Appcompat error. I already change the API 21 for google maps. But still have some error

这是我的logcat.What是问题所在

D:\Android\SCBG\app\build\intermediates\res\merged\debug\values-v23\values-v23.xml
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(24) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\ABC\AppData\Local\Android\sdk\build-tools.0.2\aapt.exe'' finished with non-zero exit value 1

这是我的 build.gradle。有人能告诉我 appcompat.I 有什么问题吗?只是初学者。请帮助 。是compilesdkversion有问题还是其他问题?

// Top-level build file where you can add configuration options common to all sub-projects/modules.





buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'



        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}




apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion '22.0.1'

    defaultConfig {
        applicationId "kianyang.scbg"
        minSdkVersion 14
        targetSdkVersion 14
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile 'com.google.android.gms:play-services-identity:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
}

你的logcatreturns

Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(24) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

首先您需要升级 compileSdkVersion & buildToolsVersion

The buildToolsVersion property specifies what version of the build tools to use .

The compileSdkVersion property specifies the compilation target.

targetSdkVersion — Specifies the API Level on which the application is designed to run. In some cases, this allows the application to use manifest elements or behaviors defined in the target API Level, rather than being restricted to using only those defined for the minimum API Level.

你应该使用

android {
compileSdkVersion 23
buildToolsVersion '23.0.1'

defaultConfig {
    applicationId "kianyang.scbg"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}

你应该打电话给

 compile 'com.android.support:appcompat-v7:23.1.0'

然后 Clean-Rebuild-Restart-Sync Your App。希望对您有所帮助。

检查这个:

 apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "kianyang.scbg"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

android {
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
    }
  }
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.1.0'
}

添加后同步您的 gradle。