Reputation: 37
I am new and now using Android Studio. I have created single page design using XML but when i run the code using the emulator this message appears:
Information:Gradle tasks [:app:assembleDebug] C:\Users\MHTAREQ\AndroidStudioProjects\JustJava\app\src\main\res\layout\activity_main.xml Error:(10) No resource identifier found for attribute 'fontColor' in package 'android' Error:(21) No resource identifier found for attribute 'fontColor' in package 'android'
C:\Users\MHTAREQ\AndroidStudioProjects\JustJava\app\build\intermediates\res\merged\debug\layout\activity_main.xml
Error:(10) No resource identifier found for attribute 'fontColor' in package 'android' Error:(21) No resource identifier found for attribute 'fontColor' in package 'android' Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt Information:BUILD FAILED Information:Total time: 1 mins 25.346 secs Information:5 errors Information:0 warnings Information:See complete output in console
Here is the XML code:
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.android.justjava.MainActivity">
<TextView
android:id="@+id/quantity_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="quantity"
android:textAllCaps="true"
android:textSize="16sp"
android:fontColor="@android:color/black"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"/>
<TextView
android:id="@+id/zero_text_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:layout_below="@+id/quantity_text_view"
android:textSize="16sp"
android:fontColor="@android:color/black"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="order"
android:textAllCaps="true"
android:layout_below="@+id/zero_text_view"
android:layout_marginLeft="16dp"
android:layout_marginTop="16dp"
android:onClick="submitOrder"/>
Please help.
Upvotes: 0
Views: 1677
Reputation: 1205
There is no specific "fontColor" attribute of TextView, that is why it is giving you that error.
Add
android:textColor="#FFFFFF"
and then clean your project and rebuild.
Upvotes: 0