Ami*_* De 5 xml layout dependencies android androidx
我最近更新到 Android 3.3,现在很多依赖项都改成了AndroidX
. 这导致应用程序崩溃,并且还需要更改依赖项XML
。我遇到了类似的问题CoordinatorLayout
。我搜索了stackoverflow,关于这个主题的问题并不多,因为AndroidX
它相对较新。所以我觉得有必要在这方面提出一个问题。
我在哪里可以获得FloatingActionButton
类似的xmlXML
是否有一个网站,我们可以在那里获得 androidX 依赖项的 XML。
XML
<android.support.design.widget.FloatingActionButton
Run Code Online (Sandbox Code Playgroud)
崩溃日志
android.view.InflateException:二进制 XML 文件第 15 行:二进制 XML 文件第 15 行:错误膨胀类 android.support.design.widget.FloatingActionButton 引起:android.view.InflateException:二进制 XML 文件第 15 行:错误膨胀类 android.support.design.widget.FloatingActionButton 引起:java.lang.ClassNotFoundException:在路径上找不到类“android.support.design.widget.FloatingActionButton”:DexPathList[[zip file”/data/app/com .kc.unsplashdemo-kTZQS-p2845Xly7PcTuAmg==/base.apk”,压缩文件“/data/app/com.kc.unsplashdemo-kTZQS-p2845Xly7PcTuAmg==/split_lib_dependencies_apk.apk”,压缩文件
依赖
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':androidunsplash')
implementation 'com.squareup.picasso:picasso:2.71828'
implementation("com.squareup.okhttp3:okhttp:3.12.0")
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.1'
}
Run Code Online (Sandbox Code Playgroud)
Fra*_*pos 10
您可以在此处找到旧 android依赖项与使用androidx的新依赖项的映射
在那里你会找到你正在寻找的依赖项:
com.google.android.material.floatingactionbutton.FloatingActionButton
Run Code Online (Sandbox Code Playgroud)
在替换布局上的某些内容时,我建议使用ctrl + r
它在整个项目中更新它并节省您的时间,因为在迁移到 androidx 时确实有很多手动工作要做。