Does AndroidX need be supported explicitly

385

You need to explicitly migrate a Flutter app to Android X by using Migrate to AndroidX... button located under Refactor tab of Android Studio. Manual migration is not recommended. If a plugin requires Android X, you need to perform this migration.

For the related article on Flutter.io, see: https://flutter.io/docs/development/packages-and-plugins/androidx-compatibility

Share:
385
AD8
Author by

AD8

Updated on December 09, 2022

Comments

  • AD8
    AD8 over 1 year

    I am learning flutter, and while playing around with flutter's Geolocator 3.0.0 package. I came across an issue that wouldn't let me compile the app as soon as I add the reference to this package in pubspec.yaml file. A quick google search showed me the right github issue. The fix mentioned in the github issue (migrating app to support AndroidX - by updating compileSdkVersion in build.gradle file to 28, and adding android.useAndroidX=true and android.enableJetifier=true in gradle.properties) does work.

    Main question: I am not sure if this (migrating project to support AndroidX) will need to be done for all flutter projects explicitly or is there a way to ensure all new flutter projects support AndroidX.

    PS:I come from C# background, and I know nearly nothing about android / iOS app development.

    • Günter Zöchbauer
      Günter Zöchbauer over 5 years
      You need to migrate every Flutter plugin project and other projects that use such plugins.
    • AD8
      AD8 over 5 years
      @GünterZöchbauer Thanks for very quick response, and would you know if it is always going to be the case? Btw, I have seen your answers on many flutter questions and found them helpful too.
  • AD8
    AD8 over 5 years
    I read this exact article and sort of understood the migration bit, but would you know if this manual migration is interim solution or is that how that is always going to be?
  • Ugurcan Yildirim
    Ugurcan Yildirim over 5 years
    I don't think you should worry about if this is an interim or not. Just migrate to Android X if you need, and you are good to go.