将我的应用程序更新到 AndroidX 并添加 Firebase 后,它不再构建,抱怨包含包文字的类。它是由 Jetifier 引起的。我在我的 Android 项目上运行了 Bye Bye Jetifier 插件,这是输出:
=========================================
Project: app
=========================================
[WARN] The file 'shadow/bundletool/com/android/SdkConstants.class' contains a string literal with a package reference 'android.support.design.widget'. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. But if you are sure there is no need to transform this package reference you can ignore this message or exclude this file from scanning using the 'excludedFilesFromScanning' property.
[WARN] The file 'com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.class' contains a string literal with a package reference 'android.support.v4'. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. But if you are sure there is no need to transform this package reference you can ignore this message or exclude this file from scanning using the 'excludedFilesFromScanning' property.
[WARN] The file 'com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.class' contains a string literal with a package reference 'android.support.v4.content'. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. But if you are sure there is no need to transform this package reference you can ignore this message or exclude this file from scanning using the 'excludedFilesFromScanning' property.
[WARN] The file 'com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.class' contains a string literal with a package reference 'android.support.v4.widget'. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. But if you are sure there is no need to transform this package reference you can ignore this message or exclude this file from scanning using the 'excludedFilesFromScanning' property.
[WARN] The file 'com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.class' contains a string literal with a package reference 'android.support.v4.view'. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. But if you are sure there is no need to transform this package reference you can ignore this message or exclude this file from scanning using the 'excludedFilesFromScanning' property.
[WARN] The file 'com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.class' contains a string literal with a package reference 'android.support.v4.media'. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. But if you are sure there is no need to transform this package reference you can ignore this message or exclude this file from scanning using the 'excludedFilesFromScanning' property.
[WARN] The file 'com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.class' contains a string literal with a package reference 'android.support.v13'. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. But if you are sure there is no need to transform this package reference you can ignore this message or exclude this file from scanning using the 'excludedFilesFromScanning' property.
[WARN] The file 'com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.class' contains a string literal with a package reference 'android.support.v13.view'. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. But if you are sure there is no need to transform this package reference you can ignore this message or exclude this file from scanning using the 'excludedFilesFromScanning' property.
[WARN] The file 'com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.class' contains a string literal with a package reference 'android.support.v13.app'. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. But if you are sure there is no need to transform this package reference you can ignore this message or exclude this file from scanning using the 'excludedFilesFromScanning' property.
[WARN] The file 'com/android/tools/build/jetifier/processor/transform/bytecode/CoreRemapperImpl.class' contains a string literal with a package reference 'android.support.design.widget'. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. But if you are sure there is no need to transform this package reference you can ignore this message or exclude this file from scanning using the 'excludedFilesFromScanning' property.
[WARN] The file 'com/android/SdkConstants.class' contains a string literal with a package reference 'android.support.design.widget'. Libraries using reflection such as annotation processors need to be updated manually to add support for androidx. But if you are sure there is no need to transform this package reference you can ignore this message or exclude this file from scanning using the 'excludedFilesFromScanning' property.
真诚地,我不知道如何从我的项目中删除这些遗留类。我扫描并仔细检查了所有内容,但找不到android.support.v4
曾经使用过的地方。Android Studio > Refactor > Migrate to AndroidX 说“没有用法”。一切看起来都很好。我能做些什么?