安卓工作室 - 错误 : No resource found that matches the given name: attr 'metaButtonBarButtonStyle'

标签 android android-studio

我遇到了一个奇怪的问题......

/res/all/debug/values/values.xml:877: 错误:错误:找不到与给定名称匹配的资源:attr 'metaButtonBarButtonStyle'。

理论上所有的 sdk`s 和附加组件都可以。有没有人知道可能是什么? ----build.gradle-- 使用 sdk 19.

repositories {
    mavenCentral()
}

apply plugin: 'android'

dependencies {
    compile 'com.squareup:otto:1.3.4'
    compile 'com.squareup.dagger:dagger:1.0.1'
    compile files('libs/volley.jar')
    compile files('libs/android-async-http-1.4.4.jar')
    compile 'com.android.support:support-v4:19.1.0'
    compile 'com.google.android.gms:play-services:4.4.52'
    compile 'com.android.support:appcompat-v7:19.1.0'
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 19
    }

}

最佳答案

今天,我也看了 Android sample full screen Demo,我发现你也有同样的问题。 当我阅读所有 res 文件时,我明白了。我可以用 demo 编写相同的代码,没有问题。有一些步骤: 1.创建你自己的样式文件并编写它: 示例:

 <!-- Backward-compatible version of ?android:attr/buttonBarStyle -->
  <style name=\"btnbar\">`enter code here`
    <item name="android:paddingLeft">2dp</item>
    <item name="android:paddingTop">5dp</item>
    <item name="android:paddingRight">2dp</item>
    <item name="android:paddingBottom">0dp</item>
    <item name="android:background">@android:drawable/bottom_bar</item>
 </style>

2.创建attrs.xml,并用ButtonBar写attr.sample是这样的:

 <!-- Backward-compatible version of ?android:attr/buttonBarStyle -->
 enter code here 2dp 5dp 2dp 0dp 
 <declare-styleable name="ButtonBarContainerTheme">
    <attr name="metaButtonBarStyle" format="reference" />
    <attr name="metaButtonBarButtonStyle" format="reference" />
 </declare-styleable>

关于安卓工作室 - 错误 : No resource found that matches the given name: attr 'metaButtonBarButtonStyle' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23818083/

相关文章:

android - Profiler 无法检测到我的设备

java - Volley deliverResponse 未被调用

java - 未找到 Gradle DSL 方法 : 'google()'

android - 错误 :(31, 0) 未找到 SDK 位置。苹果操作系统

Android:媒体播放器警告 (1,44)

android - 在服务器代理后面设置 Android SDK?

android - 如何在构建过程中从Android库项目aar Artifact 中排除库jar?

ios - Flutter - iOS 模拟器 "not supported devices connected"

Gradle 项目刷新失败,错误 : Cause: invalid address family type

android - 如何在没有 AlarmManager 的情况下使用 Android 的传感器批处理