How do I know if my development environment is compatible with Androidx?

Asked

Viewed 246 times

0

My project was created long ago and I don’t know if it is compatible with Androidx how could I identify it? And how to upgrade to make it compatible with Androidx?
(I am using vscode)

  • See this post from Flutter’s own website: Migration to Androidx.

  • I saw but my English is terrible, I did not understand if "android.useAndroidX=true android.enableJetifier=true" means it is compatible or not.

  • 1

    If the file android/gradle.properties (or .android/gradle.properties) has these declared "directives", it means that he is using Androidx.

1 answer

2


Android X

To better understand what the AndroidX read the Overview of Androidx that explains in more detail the theme. Highlight for a brief understanding:

Androidx is a major improvement to the original Android Support Library, which is no longer maintained. androidx packages fully replace the Support Library, providing resource parity and new libraries.

Check design

The directory android within the Flutter project has a file called gradle.properties and it is in this file that the statement is whether or not your Android project is using Androidx. The flags below determine this:

android.useAndroidX=true
android.enableJetifier=true

If they are not like this in your project it is not using and it is recommended to upgrade to have greater compatibility with lib's imported into your Flutter project.

The reason it is recommended to upgrade is due to imported packages made with Androidx not working on projects not using Androidx and vice versa. And the vast majority of packages are already coming with it active, so if your project is not you will be limited to the version of a package that has not migrated.

It is important to note that you should check the packages your project is using. They must have migrated as well. Check each of them if they are already in the version that your project uses.

How to migrate

The best way to migrate to Androidx is within the Android Studio IDE. There is an option inside it that automatically does the whole process and even allows you to backup the previous version of the project.

Then just follow the Androidx Migration Documentation on the Flutter page.


Extra tip: When you find articles and documentation in English on the internet, there is the option to translate the page within Chrome. It may not be 100% accurate in translation but it is a great help for people who do not understand English well. To use just open the site that is in English, right-click and select the "Translate page" option. English is very important but it cannot be a taboo that prevents you from evolving in knowledge. Use this tool whenever you need and practice a lot until the time comes to stop depending on it.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.