2017-05-26 1 views
0

に登録されていない私はvalues.xml URI is not Registeredでエラーを持って、原因URIがvalues.xml

Error:(729, 21) No resource found that matches the given name: attr 'listTextColor'.

Error:(728, 21) No resource found that matches the given name: attr 'colorMain'.

Error:(728, 21) No resource found that matches the given name: attr 'colorMain'.

Error:(729, 21) No resource found that matches the given name: attr 'listTextColor'.

Error:Execution failed for task ':app:processDebugResources'.

com.android.ide.common.process.ProcessException: Failed to execute aapt

に失敗したビルドしかし、私はcolors.xmlでcolorMainlistTextColor

EDIT colors.xmlを持っています

<color name="colorMain">#fff</color> <color name="listTextColor">#fff</color>

I UここSED:

、RESディレクトリにある「カラー」フォルダを作成し、カラーリソースファイルを追加し、カラーxmlファイルに次のように色を定義
`<EditText 
       android:id="@+id/edittxtPassword" 
       android:layout_width="match_parent" 
       android:layout_height="45dp" 
       android:background="@color/listTextColor" 
       android:hint="Enter your Password" 
       android:inputType="number" 
       android:maxLength="10" 
       android:paddingBottom="5dp" 
       android:paddingLeft="45dp" 
       android:paddingRight="5dp" 
       android:paddingTop="5dp" />` 
+0

colorsMainとlistTextColorをcolors.xmlでどのように定義したか貼り付け – santak

+0

colors.xmlを貼り付けることができますか?そしてあなたはその色をどこで参照しますか? –

+0

@santak pls編集 – Bullet

答えて

1

問題がcolorMainlistTextcolorのエントリが存在していますstyles.xmlで

次に、エントリを削除して再構築しました。ビルドは成功しました。

2

<?xml version="1.0" encoding="utf-8"?> 
<selector xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item android:color="@android:color/black" /> 
    <item android:color="@android:color/white" /> 
</selector> 
関連する問題