安卓module打包成aar文件,运行后报错java.lang.NoSuchMethodError: 5C

报错信息:
java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/view/OnApplyWindowInsetsListener;)V in class Landroid/support/v4/view/ViewCompatLollipop; or its super classes (declaration of 'android.support.v4.view.ViewCompatLollipop' appears in /data/app/com.b1993423839.zsa-1/base.apk:classes46.dex)

下面是我的v4和v7包都放在module的libs中引用,版本都是一致的,最后打包的时候也是将引用的aar文件放入主项目的libs中引用,最后将module的aar引入到主项目中,为啥运行的时候会出现找不到v4的方法呢?
//安卓高级组件implementation(name: 'recyclerview-v7-25.2.0', ext: 'aar')
implementation(name: 'constraint-layout-1.0.2', ext: 'aar')
implementation files('libs/constraint-layout-solver-1.0.2.jar')
implementation(name: 'design-25.2.0', ext: 'aar')

//安卓兼容包
implementation(name: 'animated-vector-drawable-25.2.0', ext: 'aar')
implementation(name: 'appcompat-v7-25.2.0', ext: 'aar')
implementation(name: 'support-compat-25.2.0', ext: 'aar')
implementation(name: 'support-core-ui-25.2.0', ext: 'aar')
implementation(name: 'support-core-utils-25.2.0', ext: 'aar')
implementation(name: 'support-fragment-25.2.0', ext: 'aar')
implementation(name: 'support-media-compat-25.2.0', ext: 'aar')
implementation(name: 'support-v4-25.2.0', ext: 'aar')
implementation(name: 'support-vector-drawable-25.2.0', ext: 'aar')
implementation(name: 'transition-25.2.0', ext: 'aar')
implementation files('libs/support-annotations-25.2.0.jar')

图片说明

2个回答

包冲突吧。同时引入V4和V7包

u012345683
Super-B 应该是
接近 2 年之前 回复

implementation fileTree(include: ['*.aar'], dir: 'libs') 使用这种方式引入试试看

u012345683
Super-B
接近 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问