kanyun-inc / Kace

Kace: Kotlin Android Compatible Extensions, a framework for assisting in the seamless migration from kotlin-android-extensions
Apache License 2.0
263 stars 12 forks source link

打正式包报错:java.lang.IllegalAccessError: Interface androidx.lifecycle.g implemented by class com.kanyun.kace.KaceLifecycleObserver is inaccessible #57

Closed xiaoanPan closed 8 months ago

xiaoanPan commented 10 months ago

FATAL EXCEPTION: main java.lang.IllegalAccessError: Interface androidx.lifecycle.g implemented by class com.kanyun.kace.KaceLifecycleObserver is inaccessible (declaration of 'com.kanyun.kace.KaceLifecycleObserver' appears in /data/app/~~YjuKoSvl_m5FX6jH7uXQcg==/com.nono.android-s4kgtMxsafLHXr4M8v3Nnw==/base.apk!classes2.dex) at com.kanyun.kace.AndroidExtensionsFragment.(SourceFile:4) at com.kanyun.kace.d.h0(SourceFile:5) at

xiaoanPan commented 10 months ago

版本:com.kanyun.kace:kace-gradle-plugin:1.9.20-1.2.0

bennyhuo commented 10 months ago

"androidx.lifecycle:lifecycle-common:2.4.0"

需要加一下依赖,这个后面我们在文档里面补充一下

xiaoanPan commented 10 months ago

Snipaste_2023-12-29_09-47-39 感谢回复,但这个依赖我在看其他issue的时候已经加过了,问题还是一样的,因为arouter里面也有lifecycle-common,所以我指定了一下版本是2.4.0,问题是一样的。

xiaoanPan commented 10 months ago

另外,我检查过了包依赖,所有lifecycle-common的引用都已经是2.4.0,类似下面这张图: image

bennyhuo commented 10 months ago

能提供一个可以复现问题的最小 Demo,我们分析一下吗?

xiaoanPan commented 10 months ago

-keep class androidx.lifecycle.* { ; } 虽然不知道为什么会有混淆的问题,但是我加上这句混淆之后就ok了,感谢您对这个问题的关注。