gpt4 book ai didi

android - 迁移到 Jetpack/AndroidX 后的 InflateException

转载 作者:搜寻专家 更新时间:2023-11-01 07:41:57 25 4
gpt4 key购买 nike

通过 Android Studio 迁移到 Jetpack,尝试运行应用程序但在应用程序关闭时继续获取以下跟踪信息:

Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.google.android.material.floatingactionbutton.FloatingActionButton

这是 xml:

<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
style="@style/Widget.MaterialComponents.FloatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_marginRight="10px"
android:layout_marginBottom="200px"
android:src="@drawable/ic_plus"
android:tint="#FFF"
app:fabSize="mini" />

这是我的依赖项:

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0-alpha03'
implementation 'com.google.android.material:material:1.1.0-alpha04'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.2-alpha2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0-alpha02'
implementation 'com.facebook.android:facebook-login:4.41.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.github.aakira:expandable-layout:1.6.0@aar'
implementation 'com.squareup.picasso:picasso:2.71828'
compileOnly 'org.projectlombok:lombok:1.18.6'
annotationProcessor 'org.projectlombok:lombok:1.18.6'
implementation 'com.ramotion.fluidslider:fluid-slider:0.2.0'
implementation 'com.uber.sdk:rides-android:0.10.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha03'
implementation 'androidx.cardview:cardview:1.0.0'

def lifecycle_version = '2.1.0-alpha03'

// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation 'com.google.maps.android:android-maps-utils:0.5+'
implementation 'com.shawnlin:number-picker:2.4.8'
}

最佳答案

我在示例项目中尝试了您的 XML。有用。但是你的主题应该从 Theme.MaterialComponents.blabla....

扩展

喜欢这个xml block

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

关于android - 迁移到 Jetpack/AndroidX 后的 InflateException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55246187/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com