Is there a non-painful way to migrate to AndroidX?...
# android
j
Is there a non-painful way to migrate to AndroidX? I’m not sure wheteher Android Studio’s
Migrate to AndroidX
is broken in general or just in my project
l
That option is the
non-painful
way to do that 😄
🤔 1
j
Yes, if it worked! The documentation is quite sparse and I don’t know if I’m doing something wrong https://developer.android.com/jetpack/androidx/migrate
What should I do? - upgrade to support libraries 28.0.0 - add
android.useAndroidX=true
- what else? add the androidx dependencies?
b
It’s quite a long list of things to do
w
b
not sure if I’ve ever seen it written out anywhere
l
Last time I just hit the
Android Studio
button and was done 🙂
d
When I migrated my app to AndroidX, I used the
migrate to AndroidX
button and had some errors - I went one by one and updated packages manually and it worked
☝️ 1
m
Better update to support lib version 28 first, then use the migrate to androix
l
d
The tool normally....works well. I have done it on 3 different projects. One, had 5 modules. 👍
o
You can't do it in a completely painless way. We've got a project with more than 100 modules. 1) Make sure your gradle and IDE are in sync 2) Clean and rebuild the project 3) Run the migration tool The problem usually is that you might have some third-part libraries that uses the old support libraries, so you might want to enable jetifier in your
gradle.properties
Copy code
android.enableJetifier=true
The only thing you can do after that is going on each of the screens: - Activities - Fragments - RecyclerView (make sure that the inflation of your different adapter views happen) If something goes wrong the app will just crash, no misbehavior.
k
One small thing I want to add here is like , You are using any image which is starting with
http:
, this should not work , you have to use
https:
And the problem with orientations as well. so we have to take care of these things