gpt4 book ai didi

android - 找不到与给定名称匹配的资源(在 'color' 处,值为 '@color/common_signin_btn_light_text_pressed' )

转载 作者:行者123 更新时间:2023-11-29 15:44:50 25 4
gpt4 key购买 nike

我之前使用 Android Studio 1.1 构建了我的应用程序。那时我没有问题。升级后,当我尝试重建我的应用程序时出现以下错误。

D:\-----\src\main\res\color\common_signin_btn_text_dark.xml
Error:(4, 55) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_dark_text_pressed').
Error:(5, 85) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_dark_text_disabled').
Error:(6, 55) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_dark_text_focused').
Error:(7, 56) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_dark_text_disabled').
Error:(8, 26) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_dark_text_default').
D:\-------\src\main\res\color\common_signin_btn_text_light.xml
Error:(4, 55) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_light_text_pressed').
Error:(5, 85) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_light_text_disabled').
Error:(6, 55) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_light_text_focused').
Error:(7, 56) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_light_text_disabled').
Error:(8, 26) No resource found that matches the given name (at 'color' with value '@color/common_signin_btn_light_text_default').
Error:Execution failed for task ':colorBookPro:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\Admin\AppData\Local\Android\sdk1\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1

我尝试搜索解决方案,但找不到任何解决方案。这是我的 build.gradle 文件

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion '22.0.1'

defaultConfig {
applicationId "com.demo"
minSdkVersion 10
targetSdkVersion 18
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
}

dependencies {
compile project(':main')
compile project(':library')
compile 'com.google.android.gms:play-services:8.3.0'
compile files('libs/StartAppInApp-2.4.7.jar')
}

文件在 res/color 文件夹中,如下所示。 click here for image我还尝试使用 API 23 和构建工具 23.0.1 以及许多其他选项。我似乎不明白这个问题,因为它第一次不存在。我在 2 个月前构建了该应用程序。我是编码新手,所以如果我写了一些愚蠢的东西,请多多包涵。我希望有一个人可以帮助我。

提前致谢。

最佳答案

image describing where its located

color.xml 中,您可以按如下方式定义颜色:

<?xml version="1.0" encoding="utf-8"?>
<resources>

<item name="blue" type="color">#FF33B5E5</item>
<item name="purple" type="color">#FFAA66CC</item>
<item name="green" type="color">#FF99CC00</item>
<item name="orange" type="color">#FFFFBB33</item>
<item name="red" type="color">#FFFF4444</item>
<item name="darkblue" type="color">#FF0099CC</item>
<item name="darkpurple" type="color">#FF9933CC</item>
<item name="darkgreen" type="color">#FF669900</item>
<item name="darkorange" type="color">#FFFF8800</item>
<item name="darkred" type="color">#FFCC0000</item>

<integer-array name="androidcolors">
<item>@color/blue</item>
<item>@color/purple</item>
<item>@color/green</item>
<item>@color/orange</item>
<item>@color/red</item>
<item>@color/darkblue</item>
<item>@color/darkpurple</item>
<item>@color/darkgreen</item>
<item>@color/darkorange</item>
<item>@color/darkred</item>
</integer-array>

关于android - 找不到与给定名称匹配的资源(在 'color' 处,值为 '@color/common_signin_btn_light_text_pressed' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34628092/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com