为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

桃花长相依 2019-07-23 18:54:32
无法在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"             />
查看完整描述

3 回答

?
慕斯709654

TA贡献1840条经验 获得超5个赞

在这个网站上发现它,它适用于我。修改/res/values/styles.xml来自:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"></style>

至:

<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar"></style>


查看完整回答
反对 回复 2019-07-23
?
开满天机

TA贡献1786条经验 获得超13个赞

方法1:

定位 /res/values/styles.xml

更改

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

<style name="AppTheme" 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


查看完整回答
反对 回复 2019-07-23
  • 3 回答
  • 0 关注
  • 672 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信