Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updated Android SDK and Android Studio messed up all my XMLs: "Element XXX not allowed here"

Tags:

android

xml

I just updated my Android Studio and Android SDK, and now I can't do anything in my XMLs. It shows the same thing as previous, but I can't add anything and something got messed up.

Example:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal">
    <ImageView
        android:id="@+id/bocterAppLogo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:src="@drawable/bocterapp"
        android:contentDescription=""/>
</LinearLayout>

It error says: "Element ImageView is not allowed here".

Do you have any idea why this has happened?

Cheers!

like image 908
Vlad Iancu Avatar asked Dec 01 '14 12:12

Vlad Iancu


1 Answers

I had the same problem. Try to exchange the ImageView with the android.support.v7.widget.AppCompatImageView! That solved it for me.

like image 198
prograde Avatar answered Nov 19 '22 21:11

prograde