Hey devs.
I like to migrate my old repositories to the latest android version. Any ideas or article that can make it easier? I'm planning to continue my old projects.
Hey devs.
I like to migrate my old repositories to the latest android version. Any ideas or article that can make it easier? I'm planning to continue my old projects.
For further actions, you may consider blocking this person and/or reporting abuse
ispmanager.com -
Kuru -
Pulkit Singh -
Amit Kumar -
Top comments (2)
Hi Mina,
The difficulty of migration depends on how older the projects are. The latest version of Android Studio ships with
Upgrade Assistant
which automatically helps with upgrading an older android project. It does that by detecting thegradle
version of the project and asks for confirmation to upgrade. While this is not guaranteed to be 100% successful, it can be a good start.In addition, I'd recommend taking this approach.
Assumption: You have installed the latest stable version of android studio & JDK.
Preparation Step:
Create a brand new project in the Android Studio with a simple screen & Run the app. Since Android Studio auto-generates the project files, it will have the latest/stable Gradle, Gradle-wrapper versions, and the android libraries version. Note these values from the
build.gradle
file.build.gradle
gradle-wrapper.properties
Now open the old project,
The first step is to ensure the app can sync (i.e., the android SDK, Support libraries & 3rd party libraries are downloaded). The gradle sync/build will most likely fail if the gradle version is older. I'd replace the
gradle
version &gradle-wrapper
versions and sync.Note::
jcenter()
is no longer available, usegoogle()
&mavenCentral()
for repositoriesThe second step is to check if the app can be built with the existing code & library versions. The success of this step depends on the current code (assumption: free of compilation error) & availability of Android Support & 3rd party libraries.
The last step is to update the necessary libraries & bringing the app up to date. Android Studio would show warnings on obsolete versions and help update the libraries. Android Studio also supports updating Kotlin migration from older to the latest versions.
Thank you!!! I will definitely try this. 🙂