Contains references to both AndroidX and old support library

Nicks picture Nicks · Aug 26, 2020 · Viewed 8.6k times · Source

After upgrating flutter version to Flutter 1.22.0-2.0.pre.78 • channel master I am getting this warning:-

WARNING: [Processor] Library 'C:\Users....gradle\caches\modules-2\files-2.1\io.flutter\flutter_embedding_debug\1.0.0-b1d9f863db32cb1d6714cf75db4a992ee3765113\b8748b5192a2a0961f5c14f8845331ad5f2225a1\flutter_embedding_debug-1.0.0-b1d9f863db32cb1d6714cf75db4a992ee3765113.jar' contains references to both AndroidX and old support library. This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway. Example of androidX reference: 'androidx/annotation/VisibleForTesting' Example of support library reference: 'android/support/annotation/NonNull'`

Is this issue will cause some serious issue in future or not. Thanks in Advance :)

Answer

MαπμQμαπkγVπ.0 picture MαπμQμαπkγVπ.0 · Nov 1, 2021

This warning exist because on the latest Flutter versions newly created projects will be created with AndroidX automatically.

Starting from Flutter v1.12.13, new projects created with flutter create -t <project-type> use AndroidX by default.

Projects created prior to this Flutter version must not depend on any old build artifact or old Support Library class.

In an app or module project, the file android/gradle.properties or .android/gradle.properties must contain:

android.useAndroidX=true
android.enableJetifier=true

The warning also stated:

This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway.

This is usually caused by some plugins that was not migrated and Flutter tool uses Jetifier which will automatically migrate those Flutter plugins using the Support Library to AndroidX.

The Flutter tool uses Jetifier to automatically migrate Flutter plugins using the Support Library to AndroidX, so you can use the same plugins even if they haven’t been migrated to AndroidX yet.

You can open an issue to GitHub if you've encounter other issues when migrating to AndroidX.