Android代码混淆时出现EventBus - Subscriber class and its super classes have no public methods with the @sub

樊宏邈
2023-12-01

程序中用到了EventBus 包,打包时出现EventBus - Subscriber class and its super classes have no public methods with the @subscribe annotation,
解决方案:在混淆配置文件中添加如下代码就可以解决了

-keepattributes *Annotation*
-keepclassmembers class ** {
    @org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }

 类似资料: