JailedBird / ArouterGradlePlugin

Arouter auto register plugin for AGP7.4+ & AGP8
Apache License 2.0
43 stars 7 forks source link

运行报错 NoClassDefFoundError: Failed resolution of: Lcom/alibaba/android/arouter/routes/ARouter #8

Closed NEIL-ORZ closed 5 months ago

NEIL-ORZ commented 6 months ago

` dependencies { classpath "io.github.JailedBird:arouter-gradle-plugin:1.0.1" } }

apply plugin: "io.github.JailedBird.ARouterPlugin" ` 使用以上代码,从 agp 4.2 升级到 agp 7.4.2 时运行正常,再升级到 agp 8.2.2 时运行初始化过程中报错,求解一下,麻烦了 image. 1711966840(1)

JailedBird commented 6 months ago

build目录下找到对应产物apk,打开看下dex里面这个插装类是否存在; image

JailedBird commented 6 months ago

你的问题,类似于demo中的 ARouter$$Root$$app中报错找不到ARouter$$Group$$app,如下图:

image

但是这在Java to Class阶段是不可能出现的,因为这样会造成编译中断; 另外,这个直接使用Class类型,所以应该和混淆、R8之类的也没啥关系; 我猜的唯一原因是 插桩的时候导致这个漏掉了? 但是demo中使用AGP8.2.2中没复现出来;

希望得到你的回复,不然我三天后就关闭了哈;

测试分支:https://github.com/JailedBird/ArouterGradlePlugin/commit/eda27eee1e703d2bef8c2298412ecd3ae8addec6#diff-c0dfa6bc7a8685217f70a860145fbdf416d449eaff052fa28352c5cec1a98c06

JailedBird commented 5 months ago

没得回复,我关闭了哈; 有问题请继续反馈;

NEIL-ORZ commented 5 months ago

1.0.2-beta01 已解决