无法在Android studio中加载具有未知错误的AppCompat ActionBar

无法在Android studio中加载具有未知错误的AppCompat ActionBar下面是我的xml文件。在预览中有两个错误“无法加载具有未知错误的AppCompat ActionBar”和“无法实现多个类”。怎么能运行app.But应用程序崩溃,在Logcat中没有显示错误。

<?xml version="1.0" encoding="utf-8"?><android.support.v4.widget.DrawerLayout 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:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:openDrawer="start">
    <include
        layout="@layout/app_bar_main"
        android:layout_width="match_parent"
        android:layout_height="506dp" />
    <LinearLayout
        android:id="@+id/layout_main"
        android:orientation="vertical"
        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:weightSum="1"
        tools:context=".Activity.MainActivity">
    <LinearLayout
        android:id="@+id/main_layout"
        android:orientation="vertical"
        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:layout_weight="0.7"
        tools:context=".Activity.MainActivity">
        <!-- our tablayout to display tabs  -->
        <android.support.design.widget.TabLayout
            android:id="@+id/tabLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="50dp"
            app:tabMode="scrollable"
            app:tabSelectedTextColor="@color/colorBlack"
            app:tabTextColor="@color/colorWhite"
            />


桃花长相依
浏览 673回答 3
3回答

慕斯709654

在这个网站上发现它,它适用于我。修改/res/values/styles.xml来自:<style&nbsp;name="AppTheme"&nbsp;parent="Theme.AppCompat.Light.DarkActionBar"></style>至:<style&nbsp;name="AppTheme"&nbsp;parent="Base.Theme.AppCompat.Light.DarkActionBar"></style>

开满天机

方法1:定位&nbsp;/res/values/styles.xml更改<style&nbsp;name="AppTheme"&nbsp;parent="Theme.AppCompat.Light.DarkActionBar">至<style&nbsp;name="AppTheme"&nbsp;parent="Base.Theme.AppCompat.Light.DarkActionBar">方法2:修改模板文件(定位:android-studio/plugins/android/lib/templates/gradle-projects/NewAndroidModule/root/res/values/styles.xml.ftl)更改backwardsCompatibility!true>Theme.AppCompat<#else><#if至backwardsCompatibility!true>Base.Theme.AppCompat<#else><#if
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Android