Java 不存在导入android.support.v4.util.ArrayMap;;(迁移的简单方法是什么)迁移对于任何android项目都是必要的吗

Java 不存在导入android.support.v4.util.ArrayMap;;(迁移的简单方法是什么)迁移对于任何android项目都是必要的吗,java,android,android-studio,androidx,Java,Android,Android Studio,Androidx,在通过AndroidStudio迁移到AndroidX后,出现了注释问题(迁移的简单方法是什么),迁移对任何android项目都是必要的吗 如何在android studio中轻松迁移应用程序 错误:程序包android.support.annotation不存在 导入android.support.v4.util.ArrayMap 请参见: 应该是:androidx.annotation 您可能仍然引用了(错误的)支持库;例如: implementation "com.android

在通过AndroidStudio迁移到AndroidX后,出现了注释问题(迁移的简单方法是什么),迁移对任何android项目都是必要的吗

如何在android studio中轻松迁移应用程序

错误:程序包android.support.annotation不存在 导入android.support.v4.util.ArrayMap

请参见:

应该是:
androidx.annotation

您可能仍然引用了(错误的)支持库;例如:

implementation "com.android.support:support-v4:28.0.0"
:

注释也是如此:

https://mvnrepository.com/artifact/androidx.annotation/annotation/1.1.0
implementation "androidx.annotation:annotation:1.1.0"

所有引用都需要更新。

能否添加包含此错误消息的完整生成输出。这将使它更加清晰,并提供更多的背景。另外,您可能需要提供build.gradle依赖项
https://mvnrepository.com/artifact/androidx.annotation/annotation/1.1.0
implementation "androidx.annotation:annotation:1.1.0"