I recently updated to Android 3.3, Now a lot of dependencies are changed to AndroidX
. Which is causing the app to crash, along with dependency changes need to be done in XML
as well. I faced a similar issue with CoordinatorLayout
. I searched stackoverflow there aren't a lot of Questions on this topic, since AndroidX
is relatively new. So i felt the need to raise a question in this regard.
Where can i get xml for FloatingActionButton
similarly for all the XML
is there a website where we can get the XML for androidX dependencies.
XML
<android.support.design.widget.FloatingActionButton
Crash Logcat
android.view.InflateException: Binary XML file line #15: Binary XML file line #15: Error inflating class android.support.design.widget.FloatingActionButton Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class android.support.design.widget.FloatingActionButton Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.FloatingActionButton" on path: DexPathList[[zip file "/data/app/com.kc.unsplashdemo-kTZQS-p2845Xly7PcTuAmg==/base.apk", zip file "/data/app/com.kc.unsplashdemo-kTZQS-p2845Xly7PcTuAmg==/split_lib_dependencies_apk.apk", zip file
dependencies
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'
}
You can find the mapping for the old android dependencies against the new ones who use androidx here
There you'll find this for the dependency you're looking for:
com.google.android.material.floatingactionbutton.FloatingActionButton
When replacing something on a layout I'd suggest using ctrl + r
to update it in the whole project and save you time, as there's indeed quite a bit of manual work to do when migrating to androidx.
Adding a dependency for androidX is not enough. To migrate your components to the androidX one, you have to change them manually. While searching for all the new packages may be time consuming, I can suggest you to try deleting old name in your xml and then start typing a new one. If androidX dependencies are really added to your project, after you started typing Android Studio will suggest you a new package name.
Furthermore, you can look for additional information here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With