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.我的应用
跳转成功。
927

被折叠的 条评论
为什么被折叠?



