https://kotlinlang.org logo
#android
Title
# android
j

jmfayard

10/07/2019, 9:39 AM
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

Luca Nicoletti

10/07/2019, 9:40 AM
That option is the
non-painful
way to do that 😄
🤔 1
j

jmfayard

10/07/2019, 9:41 AM
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

Brian Estrada

10/07/2019, 9:46 AM
It’s quite a long list of things to do
w

wasyl

10/07/2019, 9:46 AM
b

Brian Estrada

10/07/2019, 9:46 AM
not sure if I’ve ever seen it written out anywhere
l

Luca Nicoletti

10/07/2019, 9:47 AM
Last time I just hit the
Android Studio
button and was done 🙂
d

Dominik Hys

10/07/2019, 9:48 AM
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

Michael Bernier

10/07/2019, 1:48 PM
Better update to support lib version 28 first, then use the migrate to androix
l

liminal

10/07/2019, 2:17 PM
d

Diogo Ribeiro

10/07/2019, 2:30 PM
The tool normally....works well. I have done it on 3 different projects. One, had 5 modules. 👍
o

Orfeo Ciano

10/07/2019, 4:32 PM
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

KV

10/08/2019, 5:38 AM
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