前言
编译老项目Apk时,到我这就一个app的源码,导入工程后出现如下提示:
Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.1.0-runtime (androidx.core:core:1.1.0) and support-v4-22.2.0-runtime (com.android.support:support-v4:22.2.0) Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.1.0-runtime (androidx.core:core:1.1.0) and support-v4-22.2.0-runtime (com.android.support:support-v4:22.2.0) Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.1.0-runtime (androidx.core:core:1.1.0) and support-v4-22.2.0-runtime (com.android.support:support-v4:22.2.0)
正文
原因
这是由于已经导入的依赖中有涵盖相同core版本的情况,最终导致冲突报错,解决这个办法也很简单,找到那个冲突的依赖删掉或者换成其他依赖,但这种方法不建议,使用下面的解决办法可以不需要进行删除冲突依赖同样解决问题。
我这也是项目中导入引入的jar包。
解决办法
在文件 gradle.properties (根目录下的) 写入内容:
android.useAndroidX=true android.enableJetifier=true即可解决这个报错。
参考文章
《
© 版权声明