Closed
Description
Steps to Reproduce
I wanted to add Flutter to my existing Android app. I've found this tutorial
. I've created flutter module and my next step was to create FlutterFragment. Unfortunately my app is using AndroidX dependencies while Flutter is still using Android Support Libraries.
I think this is quite major issue because a lot of Android apps are using AndroidX already, moreover with the release of Android 9.0 (API level 28) all new library development will occur only in the AndroidX library.
Android Support artifacts are no longer supported.
Metadata
Metadata
Assignees
Labels
Integration with existing apps via the add-to-app flowBackwards-incompatible API changesAffects or could affect many people, though not necessarily a specific customer.Android team may need to help usflutter/engine repository. See also e: labels.Affects the flutter_plugin_tools packageflutter/packages repository. See also p: labels.Android applications specifically"flutter build" and "flutter run" on AndroidAffects the "flutter" command-line tool. See also t: labels.
Type
Projects
Relationships
Development
No branches or pull requests
Activity
gonzalonm commentedon Nov 28, 2018
really need this change! Any updates on this?
leagmain commentedon Dec 4, 2018
I solved this issue by migrating the '.android' project to androidx using Android Studio, after that, I import flutter module to my project, and it works fine.
But remember one thing, don't delete .android project, cause flutter will re-generate one if it not exists.
dnfield commentedon Dec 20, 2018
Working on making this easier to migrate to in the Engine - we just recently rolled to a newer Android support library, but haven't yet rolled to AndroidX.
Related to #17780
ssuarezh commentedon Jan 31, 2019
I cant migrate to AndroidX with AndroidStudio --> Refactor --> Migrate to AndroidX

I have this errors
How i can migrate?
zoechi commentedon Jan 31, 2019
About migration to AndroidX see also #27128 (comment)
55 remaining items
blasten commentedon Aug 7, 2019
An update on this issue:
If you encounter this issue, then run
flutter config --enable-build-plugin-as-aar
.If you are building a full Flutter app
Run
flutter build <apk/appbundle>
. This fixes the AndroidX compatibility issue. The app must be using AndroidX, which is the result of creating the appflutter create -t app --androidx <app-directory>
.If you are building a Flutter module (Add to app)
Make sure the project is using AndroidX. e.g.
flutter create -t module --androix <module-directory>
. If the current project isn't using AndroidX, then edit the<module-directory>/pubspec.yaml
, and addNext, remove the
<module-directory>/.ios
and<module-directory>/.android
directories, so they get regenerated next time you use the Flutter tool.blasten commentedon Aug 23, 2019
The remaining issue is discussed on #38988
Hixie commentedon Aug 28, 2019
@blasten Does that mean we can close this bug? :-)
blasten commentedon Aug 28, 2019
Sounds good @Hixie. For anyone reading this thread, see #23586 (comment)
xuyisheng commentedon Apr 4, 2020
It's not work for me. I remove the .android and .ios directory, but when I regenerated them, it's just the same as before.
lock commentedon Apr 18, 2020
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -v
and a minimal reproduction of the issue.