LearningCODE
LearningCODE

Reputation: 165

Error Parsing XML; not well formed (invalid token)

I am encountering 3 errors :

Error:(8, 25) No resource found that matches the given name (at 'background' with value '@mipmap/bg').

Error:(1) Error parsing XML: not well-formed (invalid token)

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

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\George\AppData\Local\Android\sdk\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1

I do not know how to resolve these issues, any ideas? :(

activity_main.xml -->

<RelativeLayout 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" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
android:focusable="true"
android:background="@mipmap/bg"
android:clickable="true"
android:backgroundTintMode="screen">

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/ClassesOffered"
    android:id="@+id/button"
    android:background="#ff50617c"
    android:ellipsize="middle"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:onClick="getMe"/>

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/StaffButton"
    android:id="@+id/button2"
    android:background="#ff50617c"
    android:ellipsize="middle"
    android:layout_alignTop="@+id/button"
    android:layout_alignParentRight="true"
    android:layout_alignParentEnd="true" />

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageView"
    android:layout_alignParentTop="true"
    android:layout_alignRight="@+id/button2"
    android:layout_alignEnd="@+id/button2"
    android:background="@mipmap/iklogo" />

</RelativeLayout>

Upvotes: 0

Views: 1567

Answers (1)

validcat
validcat

Reputation: 6268

When such errors, I suggest you to always use the following approach: remove the part of the code and see if the error is still remains. For example in your case start with removing whole <ImageView .... /> because of suspect android:background="@mipmap/iklogo". To be completely sure - rebuild/clean project. If issue still here - remove next tag. If you find tag with error, now you refine your search and remove some param lines (for ex android:background="@mipmap/iklogo"). And you quickly find source of your issue.

Upvotes: 0

Related Questions