Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 1-加载AppCompat ActionBar失败,出现未知错误。2-未能找到样式';浮动操作按钮样式';当前主题_Android_Xml_Android Layout_Android Studio_Android Appcompat - Fatal编程技术网

Android 1-加载AppCompat ActionBar失败,出现未知错误。2-未能找到样式';浮动操作按钮样式';当前主题

Android 1-加载AppCompat ActionBar失败,出现未知错误。2-未能找到样式';浮动操作按钮样式';当前主题,android,xml,android-layout,android-studio,android-appcompat,Android,Xml,Android Layout,Android Studio,Android Appcompat,1-加载AppCompat ActionBar失败,出现未知错误 2-在当前主题中找不到样式“floatingActionButtonStyle” Xml文件显示了上述两个错误以及以下错误- 1-缺少样式。是否为此布局选择了正确的主题?使用布局上方的“主题”组合框选择其他布局,或修复主题样式引用 2-无法实例化以下类: -android.support.v7.widget.ActionBarContainer -android.support.v7.widget.ActionBarContext

1-加载AppCompat ActionBar失败,出现未知错误

2-在当前主题中找不到样式“floatingActionButtonStyle”

Xml文件显示了上述两个错误以及以下错误-

1-缺少样式。是否为此布局选择了正确的主题?使用布局上方的“主题”组合框选择其他布局,或修复主题样式引用

2-无法实例化以下类: -android.support.v7.widget.ActionBarContainer

-android.support.v7.widget.ActionBarContextView

-android.support.v7.app.WindowDeCoctionBar

-android.support.design.widget.TextInputLayout

类路径是:

   classpath 'com.android.tools.build:gradle:3.1.3'
   classpath 'com.google.gms:google-services:4.0.2'



dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

//add library
implementation 'com.android.support:design:28.0.0-beta01'
implementation 'com.firebaseui:firebase-ui-database:4.1.0'

}
apply plugin: 'com.google.gms.google-services
XML文件-

   <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"

tools:context=".MainActivity">

<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:clickable="true"
    android:focusable="true"
    android:src="@drawable/ic_send"
    android:id="@+id/fab"
    android:tint="@android:color/white"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    app:fabSize="mini"
    />
<android.support.design.widget.TextInputLayout
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:layout_toLeftOf="@+id/fab"
    android:layout_alignParentBottom="true"

    android:layout_toStartOf="@+id/fab"
    android:layout_alignParentStart="true"

    android:layout_alignParentLeft="true"
    >

    <EditText
        android:id="@+id/input"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Message..."
        android:inputType="text" />

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

<ListView
    android:id="@+id/list_of_message"
    android:layout_alignParentTop="true"
    android:layout_alignParentStart="true"
    android:layout_above="@+id/fab"
    android:dividerHeight="16dp"
    android:divider="@android:color/transparent"
    android:layout_marginBottom="16dp"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_alignParentLeft="true">

</ListView>

</RelativeLayout>

粘贴这两个依赖项

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
而不是

implementation 'com.android.support:design:28.0.0-beta01'
implementation 'com.android.support:appcompat-v7:28.0.0-beta01'

测试版导致问题。

未能解决:com.android.support:appcompat-v7:28.0.0尝试降低依赖项的版本。