找不到与给定名称匹配的资源 iys 将我标记为颜色?

No resource found that matches the given name iys tag me to color?

大家好,我的项目遇到了我的问题

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

如果我点击 跳转到资源

> <?xml version="1.0" encoding="utf-8"?> <resources>
>     <style name="Base.TextAppearance.AppCompat.Widget.Button.Borderless.Colored"
> parent="android:TextAppearance.Material.Widget.Button.Borderless.Colored"/>
>     <style name="Base.TextAppearance.AppCompat.Widget.Button.Colored" parent="android:TextAppearance.Material.Widget.Button.Colored"/>
>     <style name="TextAppearance.AppCompat.Notification.Info.Media"/>
>     <style name="TextAppearance.AppCompat.Notification.Media"/>
>     <style name="TextAppearance.AppCompat.Notification.Time.Media"/>
>     <style name="TextAppearance.AppCompat.Notification.Title.Media"/> </resources>

我的 gradle 文件是

build.gradle(模块:AppName)`

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'Google Inc.:Google APIs:24'
    buildToolsVersion '24.0.0'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.nileworx.flagsquiz"
        minSdkVersion 11
        targetSdkVersion 24
    }

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

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':baseGameUtils')
    compile 'com.android.support:support-v4:27.0.0'
    compile 'com.google.android.gms:play-services:8.4.0'
    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'
}

build.gradle(模块:baseGameUtils)

apply plugin: 'com.android.library'

android {
 compileSdkVersion 'Google Inc.:Google APIs:24'
 buildToolsVersion '24.0.0'

 defaultConfig {
     minSdkVersion 11
     targetSdkVersion 24
 }

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

dependencies {
 compile 'com.android.support:support-v4:27.1.1'
 compile 'com.google.android.gms:play-services:+' }

顺便说一下它的游戏所以如果有人解决了请把它

当我将您的代码粘贴到我的代码中时,出现了很多格式问题,也许您的文件格式有误。 试试看:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Base.TextAppearance.AppCompat.Widget.Button.Borderless.Colored" parent="android:TextAppearance.Material.Widget.Button.Borderless.Colored" />
<style name="Base.TextAppearance.AppCompat.Widget.Button.Colored" parent="android:TextAppearance.Material.Widget.Button.Colored" />
<style name="TextAppearance.AppCompat.Notification.Info.Media" />
<style name="TextAppearance.AppCompat.Notification.Media" />
<style name="TextAppearance.AppCompat.Notification.Time.Media" />
<style name="TextAppearance.AppCompat.Notification.Title.Media" /> </resources>

查看下图

android:TextAppearance.Material.Widget.Button.Borderless.Colored 需要 API 等级 24

您可以将所有内容更改为 24 以遵循您的支持库,如下所示或更新为最新版本,这将解决问题,但请注意您的 minSDK 是 11,这意味着该样式将不适用于旧版本版本

apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
useLibrary 'org.apache.http.legacy'

defaultConfig {
    applicationId "com.nileworx.flagsquiz"
    minSdkVersion 11
    targetSdkVersion 24
}

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

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

compile project(':baseGameUtils')

compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:support-v4:24.0.0'

compile 'com.google.android.gms:play-services:7.4.0'
compile 'com.google.android.gms:play-services-ads:7.4.0'
compile 'com.google.android.gms:play-services-identity:7.4.0'
compile 'com.google.android.gms:play-services-gcm:7.4.0' 
}