onNewIntent签名冲突现在的情况运行编译一直报Inherited platform declarations clash: The following declarations have the same JVM signature (onNewIntent(Landroid/content/Intent;)V):fun onNewIntent(intent: Intent): Unit defined in xxx.MainActivityfun onNewIntent(intent: Intent?): Unit defined in xxx.MainActivity最终怎么解决的有两种方式1.当前版本是 1.9.3降到 1.8.21.8.x 最后的稳定版即可。或者2.去掉implementation(libs.androidx.activity)用implementation(libs.androidx.appcompat)依赖间接引入即可这个文件里没有 onNewIntent 方法说明它是从 BaseActivity 继承来的。问题是 Kotlin 新版本中 onNewIntent 的签名从 Intent? 变成了 Intent导致父类和 ComponentActivity 的声明冲突。让我看下 BaseActivity。Searched for 2 patterns (ctrlo to expand)● 项目代码中没有任何 onNewIntent 的定义。这说明冲突来自依赖库BaseActivity 或其父类和你当前使用的 androidx.activity 版本之间的不兼容。原因 androidx.activity:activity-ktx 1.9.0 给 ComponentActivity 添加了新的 onNewIntent(intent: Intent) (非空参数)与旧的 onNewIntent(intent: Intent?) (可空参数) 产生了 JVM 签名冲突。解决方案选其一1. 在 MainActivity 中显式重写 onNewIntent 来消除冲突override fun onNewIntent(intent: Intent) {super.onNewIntent(intent)}2. 降级 androidx.activity 版本如果不需要新版特性在 build.gradle 中将 androidx.activity:activity-ktx 固定到 1.8.x。你想用哪种方式如果选方案1我直接帮你加到 MainActivity.kt 里。✻ Brewed for 43s❯ 选择方式2试试吧Searched for 2 patterns (ctrlo to expand)● 当前版本是 1.9.3降到 1.8.21.8.x 最后的稳定版即可。