ARouter报错:ARouter::There is no route match the path [ ],in group [cloud_music][ ]

1、场景

项目中引用了ARouter,在多module之间实现跳转。在从Activity A跳转到Activity B时,跳转未能成功。

2、解决

根据官网的解决方案,进行了以下步骤的检查,还是没能解决问题:

1.检查目标页面的注解是否配置正确,正确的注解形式应该是 (@Route(path=”/test/test”), 如没有特殊需求,请勿指定group字段,废弃功能)
2.检查目标页面所在的模块的gradle脚本中是否依赖了 arouter-compiler sdk (需要注意的是,要使用apt依赖,而不是compile关键字依赖)
3.检查编译打包日志,是否出现了形如 ARouter::�Compiler >>> xxxxx 的日志,日志中会打印出发现的路由目标
4.启动App的时候,开启debug、log(openDebug/openLog), 查看映射表是否已经被扫描出来,形如 D/ARouter::: LogisticsCenter has already been loaded, GroupIndex[4],GroupIndex > 0

按步骤检查,编译及依赖不存在问题,build日志也有路由目标出现:

ע: ARouter::Compiler The user has configuration the module name, it was [……]
ע: ARouter::Compiler >>> AutowiredProcessor init. <<<
ע: ARouter::Compiler The user has configuration the module name, it was [……]
ע: ARouter::Compiler >>> InterceptorProcessor init. <<<
ע: ARouter::Compiler The user has configuration the module name, it was [……]
ע: ARouter::Compiler >>> RouteProcessor init. <<<
ע: ARouter::Compiler >>> Found routes, start... <<<
ע: ARouter::Compiler >>> Found routes, size is 5 <<<
ע: ARouter::Compiler >>> Found activity route: …… <<<
ע: ARouter::Compiler >>> Start categories, group = ……, path =…… <<<
ע: ARouter::Compiler >>> Found activity route: …… <<<
ע: ARouter::Compiler >>> Start categories, group = ……, path = …… <<<
ע: ARouter::Compiler >>> Found activity route: …… <<<
ע: ARouter::Compiler >>> Start categories, group = ……, path = …… <<<
ע: ARouter::Compiler >>> Found activity route: …… <<<
ע: ARouter::Compiler >>> Start categories, group = ……, path = …… <<<
ע: ARouter::Compiler >>> Found activity route: …… <<<
ע: ARouter::Compiler >>> Start categories, group = ……, path = …… <<<
ע: ARouter::Compiler >>> Generated group: ……<<<
ע: ARouter::Compiler >>> Generated provider map, name is ARouter$$Providers$$……<<<
ע: ARouter::Compiler >>> Generated root, name is ARouter$$Root$$……<<<
ע: ijЩ�����ļ�ʹ�û򸲸����ѹ�ʱ�� API��
ע: �й���ϸ��Ϣ, ��ʹ�� -Xlint:deprecation ���±��롣

打开ARouter日志:

ARouter.openLog();     // Print log
ARouter.openDebug();

出现以下错误:

W  ARouter::There is no route match the path [/……/……], in group [……][ ] 

尝试卸载应用重新安装,依然不成功。最后,使用adb命令清除缓存:

adb shell pm clear com.package.我的应用

跳转成功。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值