arouter 在腾讯shadow 单进程多插件中 初始化会引发 ARouter init logistics center exception!

未关闭
#1,399 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
android, java
领域
backend, mobile

调研方向

Start with the stack trace and the ARouter initialization call in CommonBusinessApplication.onCreate; the exception occurs in LogisticsCenter.init while loading the plugin route class. Reproduce with multiple plugins in one process and compare that with initializing only one plugin. Done means ARouter initializes successfully for every plugin in the reported scenario, or the supported limitation and workaround are documented.

由索引模型根据 Issue 内容生成。

描述

arouter在腾讯 shadow 框架中使用:

使用场景:
1、同一进程下,存在多个插件
2、每个插件都要使用arouter功能

在每个插件application中初始化 ARouter.init(application)的时候报如下错误:
备注:如果只是某一个插件中初始化arouter,并不会有问题,但是同一个进程下加载多个插件的时候就会出现以下异常,初步怀疑是同一进程下加载多个插件,路由信息重复注册了导致的问题?
请问下作者这个问题如何解决?

FATAL EXCEPTION: main
Process: com.seuic.kysy:takedeliveryplugin, PID: 6700
com.alibaba.android.arouter.exception.HandlerException: ARouter::ARouter init logistics center exception! [com.alibaba.android.arouter.routes.ARouter$$Root$$pluginqueryexpress]
at com.alibaba.android.arouter.core.LogisticsCenter.init(LogisticsCenter.java:196)
at com.alibaba.android.arouter.launcher._ARouter.init(_ARouter.java:63)
at com.alibaba.android.arouter.launcher.ARouter.init(ARouter.java:43)
at com.kye.pad.CommonBusinessApplication.onCreate(CommonBusinessApplication.java:31)
at com.tencent.shadow.core.loader.ShadowPluginLoader.callApplicationOnCreate$realAction(ShadowPluginLoader.kt:124)
at com.tencent.shadow.core.loader.ShadowPluginLoader.callApplicationOnCreate$lambda$4(ShadowPluginLoader.kt:132)
at com.tencent.shadow.core.loader.ShadowPluginLoader.$r8$lambda$5zn6PqYXr7Nxh2cuZZfK9BrbCmM(Unknown Source:0)
at com.tencent.shadow.core.loader.ShadowPluginLoader$$ExternalSyntheticLambda0.run(Unknown Source:6)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7713)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)

主要语言
Java
星标
7.8k
派生
1.3k
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Tencent/Shadow 的其他 Issue

查看 Tencent/Shadow 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。