解决安卓中 ARouter There is no route match the path in group问题

原文 

解决ARouter There is no route match the path in group问题

1.java项目配置问题:

ARouter配置(build.gradle的default内部)

javaCompileOptions {
 
annotationProcessorOptions {
 
arguments = [ AROUTER_MODULE_NAME : project.getName() ]
 
}
 
}
dependencies {
 
...
 
implementation 'com.alibaba:arouter-api:1.5.2'
 
annotationProcessor 'com.alibaba:arouter-compiler:1.2.1'
 
}
如果每个model都依赖一个基础库,定义在基础库下即可(都是java配置情况下,有kotlin的model需要单独配置)

2.配置路径问题

正确的注解形式应该是 (@Route(path="/test/test"),至少两级结构,首个"/"不能省掉,查看调用和注解是否一致,可以定义为常量。

3.kotlin的配置

kotlin的arouter设置(build.gradle的default内部)

kapt {
 
arguments {
 
arg("AROUTER_MODULE_NAME", project.getName())
 
}
 
}
最外层顶部需要配置apply plugin: 'kotlin-kapt'

dependencies {
 
...
 
implementation 'com.alibaba:arouter-api:1.5.2'
 
kapt 'com.alibaba:arouter-compiler:1.2.1'
 
}
4.看是否有model没有被添加依赖

implementation project(':mylibrary_common')

也可以每个model都配置一下

implementation 'com.alibaba:arouter-api:1.5.2'
 
kapt 'com.alibaba:arouter-compiler:1.2.1'


5.重启,卸载重装

原文链接:https://blog.csdn.net/sinat_29097969/article/details/119184627

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值