ARouter
ARouter copied to clipboard
💪 A framework for assisting in the renovation of Android componentization (帮助 Android App 进行组件化改造的路由框架)
混淆后注入失败
在混淆文件没有指定保护的类中使用 ARouter,开启混淆后会注入失败。 查看实现原理是通过类名 + SUFFIX_AUTOWIRED 反射生成对象。混淆后改变了类名,反射找不到 class 报错并注入失败。 在项目中有大量类使用了 @Autowired,对每一个使用了注解的类添加保护成本比较高。 但如果保留所有类名不被修改则违背了混淆的意义。 求问各位大佬有没有什么好建议
在Application中初始化 ARouter.init(this) 报错(导致App崩溃无法正常运行): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/alibaba/android/arouter/launcher/ARouter;
## Look at here - → Did you read the doc carefully - → Did you add annotation above target activity - → Did you add annotation processor dependence -...
## Look at here - → Did you read the doc carefully - → Did you add annotation above target activity - → Did you add annotation processor dependence -...
https://docs.gradle.org/7.4/userguide/configuration_cache.html ```log 4 problems were found storing the configuration cache. - Task `:app:transformClassesWithCom.alibaba.arouterForDailyDebug` of type `com.android.build.gradle.internal.pipeline.TransformTask`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not...
有个问题 变体中同功能页面的跳转 能不能实现如下的效果啊: 比如mian里面有一个MainActivity 变体channel1中有个MainActivity2 给他们标注同一个path="/main" 然后通过这个path能够在变体channel1包中专门路由到MainActivity2中,就如同gradle自动优先使用变体的同名资源一样 如果能实现这样的特性 真的对打特定维度马甲包特别的方便。 现在遇到的问题就是 如果一个path注册多个不同的类 完全按照字母排序靠前去获取的 本来是想把指定的Class比如MainActivity 从main里面抽离 然后在多个变体维度各建一个同名类的 但是发现这种方法在变体比较多,要替换的类比较多的时候太难维护了,每新建一个维度 都要添加缺少的类。 希望作者后续版本能够支持😊
看了一下还是有很多人也遇到这个问题,这边给大家一个思路,一定能解决问题: 1. 首先确定你的项目是用java还是Kotlin开发,如果是java,build配置如下: android { defaultConfig { javaCompileOptions { annotationProcessorOptions { arguments = [AROUTER_MODULE_NAME: project.getName()] } } } } dependencies { implementation 'com.alibaba:arouter-api:x.x.x' annotationProcessor 'com.alibaba:arouter-compiler:x.x.x' } 但是如果是Kotlin开发,那就不是这样配置了,我就是在这里翻车的,具体配置如下: apply plugin: 'kotlin-kapt'...
**Now you can successfully run `gradlew build`** Add missing dependeces Fix javaddoc generation error Update out of date repository
arouter是否是直接获取顶栈栈顶进行跳转的?是否可以配置这种跳转方式?
1.5.0版本有anr问题 出错堆栈 1 java.lang.reflect.Constructor.newInstance0(Native Method) 2 java.lang.reflect.Constructor.newInstance(Constructor.java:343) 3 com.alibaba.android.arouter.core.LogisticsCenter.void completion(com.alibaba.android.arouter.facade.Postcard)(LogisticsCenter.java:250) 4 com.alibaba.android.arouter.launcher._ARouter.java.lang.Object navigation(android.content.Context,com.alibaba.android.arouter.facade.Postcard,int,com.alibaba.android.arouter.facade.callback.NavigationCallback)(_ARouter.java:283) 5 com.alibaba.android.arouter.launcher.ARouter.java.lang.Object navigation(android.content.Context,com.alibaba.android.arouter.facade.Postcard,int,com.alibaba.android.arouter.facade.callback.NavigationCallback)(ARouter.java:184) 6 com.alibaba.android.arouter.facade.Postcard.java.lang.Object navigation(android.content.Context,com.alibaba.android.arouter.facade.callback.NavigationCallback)(Postcard.java:146) 7 com.alibaba.android.arouter.facade.Postcard.java.lang.Object navigation(android.content.Context)(Postcard.java:137) 8 com.alibaba.android.arouter.facade.Postcard.java.lang.Object navigation()(Postcard.java:128)