不允许的字符串类型(值“"为“蓝色") [英] String types not allowed (at 'blue' with value '')

查看:102
本文介绍了不允许的字符串类型(值“"为“蓝色")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建项目的appcompat-v7库中出现以下错误.

I am getting following error in appcompat-v7 library building the project.

    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库values.xml文件:

appcompat-v7 library values.xml file where this error is occuring:

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

我拥有最新版本的Android Studio(2.0预览版7)和appcompat-v7库.

I have latest version of Android Studio (2.0 Preview 7) and appcompat-v7 library.

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'
}

我的style.xml:

My 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'

打开您的color.xml,然后搜索蓝色"并检查您分配的颜色

open your color.xml then search for 'blue' and check you assigned color

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

这篇关于不允许的字符串类型(值“"为“蓝色")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆