【问题标题】:No parent in style in android-support-v7-appcompatandroid-support-v7-appcompat 中没有父样式
【发布时间】:2016-01-29 02:59:30
【问题描述】:

我导入了 support-v7-appcompat 库,在构建过程中我遇到了以下问题:

Error:(380, 5) String types not allowed (at 'blue' with value '').
app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1\res\values\values.xml

第 (380,5) 行:

<style name="Base.TextAppearance.AppCompat.SearchResult" parent="">
    <item name="android:textStyle">normal</item>
    <item name="android:textColor">?android:textColorPrimary</item>
    <item name="android:textColorHint">?android:textColorHint</item>
</style>

我目前正在使用 23.1.1 版本的支持库。每次我构建应用程序时都会出现这个问题。我已尝试清理代码。

build.gradle:

apply plugin: 'com.android.model.application'
model {
    android {
        compileSdkVersion 'Google Inc.:Google APIs:23'
        buildToolsVersion "23.0.2"

        defaultConfig.with {
            applicationId "com.ms.sensors"
            minSdkVersion.apiLevel 13
            targetSdkVersion.apiLevel 23
            versionCode 1
            versionName "1.0"
        }

        compileOptions.with {
            sourceCompatibility = JavaVersion.VERSION_1_7
            targetCompatibility = JavaVersion.VERSION_1_7
        }

        buildTypes {
            release {
                minifyEnabled = false
                proguardFiles.add(file('proguard-rules.txt'))
            }
        }
    }

    android.ndk {
        moduleName = "sensorgraph"
        cppFlags.add("-Werror")
        ldLibs.addAll(["log", "GLESv2", "android"])
        stl = "c++_static"
    }
}

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

如何解决这个问题?

【问题讨论】:

标签: android android-support-library android-build android-sdk-2.3


【解决方案1】:

尝试改变:

compileSdkVersion 'Google Inc.:Google APIs:23'

与:

compileSdkVersion 23

【讨论】:

  • 它存在于构建文件夹的支持库的源代码中。我无法更改它,因为它每次都是自动生成的。
  • 试试那个改变,看起来风格在寻找正确的父母方面有问题
  • 还要确保您在 android studio 中安装了正确版本的支持库和构建工具,并且 gradle 已同步
  • 我试过这个。还是没有解决问题。
猜你喜欢
  • 2015-01-29
  • 1970-01-01
  • 1970-01-01
  • 2013-08-18
  • 1970-01-01
  • 2015-05-30
  • 2013-09-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多