0

I have just updated android studio (it was long overdue), but when I create a new standard basic activity (with the built in template), I get a rendering error saying "Exception raised during rendering: android.support.design.widget.CoordinatorLayout cannot be cast to android.view.ViewGroup"

I am very confused, since it is just automatically generated code by android studio.

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 
xmlns:android="http://schemas.android.com/apk/res/android"




 xmlns:app="http://schemas.android.com/apk/com.mattdevelopment01.mateusz.homeworkhelper"
         xmlns:app2="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.mattdevelopment01.mateusz.homeworkhelper.Assignments">

<android.support.design.widget.AppBarLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/colorPrimary"
        android:theme="@style/AppTheme"
        app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.AppBarLayout>

<include layout="@layout/content_assignments" />

<android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_margin="@dimen/fab_margin"
    app2:backgroundTint="@color/colorAccent"
    app:srcCompat="@android:drawable/ic_dialog_email" />

</android.support.design.widget.CoordinatorLayout>

1 Answers1

0

The second line [xmlns:app="http://schemas.android.com/apk/com.mattdevelopment01.mateusz.homeworkhelper"] seems rather fishy. For the correct explanation of the usage of xmlns:app check this : What is XML property xmlns:app?

Try to remove the line I mentioned, and edit the third line that says xmlns:app2 to become -> xmlns:app

Karim ElGhandour
  • 337
  • 3
  • 13