升级flutter版本到后Flutter 1.22.0-2.0.pre.78 • channel 主 我收到此警告:-
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'`
这个问题是否会在 future 引起一些严重的问题。提前致谢 :)
最佳答案
存在此警告是因为在 latest Flutter versions新创建的项目将使用 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
该警告还指出:
This seems like the library is partially migrated. Jetifier will try to rewrite the library anyway.
这通常是由一些未迁移的插件和 Flutter tool uses Jetifier 引起的。这将使用支持库自动将这些 Flutter 插件迁移到 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.
您可以open an issue to GitHub如果您在迁移到 AndroidX 时遇到其他问题。
关于android - 包含对 AndroidX 和旧支持库的引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63592197/