简体   繁体   English

不允许的字符串类型(值“”为“蓝色”)

[英]String types not allowed (at 'blue' with value '')

I am getting following error in appcompat-v7 library building the project. 我在构建项目的appcompat-v7库中遇到以下错误。

    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

appcompat-v7 library values.xml file where this error is occuring: 发生此错误的appcompat-v7库values.xml文件:

   <!-- this line --> <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>

I have latest version of Android Studio (2.0 Preview 7) and appcompat-v7 library. 我拥有最新版本的Android Studio(2.0预览版7)和appcompat-v7库。

build.gradle: build.gradle:

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

        defaultConfig.with {
            applicationId "com.ms.sensors"
            minSdkVersion.apiLevel 7
            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"
    }

    android.productFlavors {
        create("arm7") {
            ndk.abiFilters.add("armeabi-v7a")
        }
        create("arm8") {
            ndk.abiFilters.add("arm64-v8a")
        }
        create("x86-32") {
            ndk.abiFilters.add("x86")
        }
        // for detailed abiFilter descriptions, refer to "Supported ABIs" @
        // https://developer.android.com/ndk/guides/abis.html#sa

        // build one including all cpu architectures
        create("all")
    }
}
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'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
}

My style.xml: 我的style.xml:

<resources>
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
</resources>

You assign empty value to 'blue' 您将空值分配给“蓝色”

open your color.xml then search for 'blue' and check you assigned color 打开您的color.xml,然后搜索“ blue”并检查您分配的颜色

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="blue"></color> <!-- must add valid value -->
</resources>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不允许使用字符串类型(在“背景”处带有value) - String types not allowed (at 'background' with value ) 不允许使用字符串类型(&#39;id&#39;的值为&#39;@id / bAdd&#39;) - String types not allowed (at 'id' with value ' @id/bAdd') 不允许的字符串类型(在&#39;android:importantForAccessibility&#39;处,值为&#39;noHideDescendants&#39;) - String types not allowed (at 'android:importantForAccessibility' with value 'noHideDescendants') 不允许使用字符串类型(“重力”值为“ end”) - String types not allowed (at 'gravity' with value 'end') Android-错误:不允许使用字符串类型(在“ imageViewScramble”中值为“”) - Android - Error:String types not allowed (at 'imageViewScramble' with value '') 错误:不允许使用字符串类型(在'screenOrientation'中,值为'sensorPortait') - Error: String types not allowed (at 'screenOrientation' with value 'sensorPortait') 不允许的字符串类型(“ spacing”值为“ 8db”) - String types not allowed (at 'spacing' with value '8db') 不允许的字符串类型(在具有路线图值的mapType处) - string types not allowed (at mapType with value roadmap) 错误:不允许使用字符串类型 - Error:String types not allowed 不允许的字符串类型(在“ android:typeface”,值为“ Calibri.ttf”) - String types not allowed (at 'android:typeface' with value 'Calibri.ttf')
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM