Problem: I installed a new Android Studio 1.5 , while creating the usual Blank Activity
main_activity.xml will not render. Here is the layout code:
<?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/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context="com.dugin_rostislav.mynewapplication.MainActivity"> <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="?attr/colorPrimary" app:popupTheme="@style/AppTheme.PopupOverlay" /> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_main" /> <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" android:src="@android:drawable/ic_dialog_email" /> </android.support.design.widget.CoordinatorLayout>
At first, nothing was displayed in the Design tab and there was an error (set API 15, Android 4.0.3):
Color Filters are not supported.
After compiling the application (it works without problems on the phone) again there is nothing and an error:
The following classes couldn’t be instantiated: - android.support.design.widget.CoordinatorLayout (Open Class, Show Exception, Clear Cache) - android.support.design.widget.AppBarLayout (Open Class, Show Exception, Clear Cache) Tip: If you use the java.lang.IllegalArgumentException: you can use the java.lang.IllegalArgumentException: you can use it. at android.support.design.widget.ThemeUtils.checkAppCompatTheme (ThemeUtils.java:34) at android.support.design.widget.CoordinatorLayout. (CoordinatorLayout.java:182) at android.support.design.widget.CoordinatorLayout. Co. .java: 176) at java.lang.reflect.Constructor.newInstance (Constructor.java:422) at android.view.LayoutInflater.inflate (LayoutInflater.java:466) at android.view.LayoutInflater.inflate (LayoutInflater.java: 372)
Question: why do errors appear, how to make it so that when a standard project is generated, everything is created without errors and how to make the layout graphically displayed in Design ?
dp
!) - user189127