解决安卓中 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

相关推荐
小羊没烦恼!3 天前
微服务化的基石——持续集成
java·大数据·word·powerpoint·.net
俊昭喜喜里3 天前
java中的继承和多态的区别
java
小羊没烦恼!3 天前
初探性能优化——2个月到4小时的性能提升
java·开发语言·windows·算法·c#
譕痕3 天前
JSONObject与JSONArray封装数据格式区别
java·json
胡写代码3 天前
别再前后端各写一套表单校验了
java·后端
小鱼能吃糖3 天前
缺陷修复总览 · mall电商项目:5类缺陷,1个病根,4个业务域
java·电商
此时不提桶,更待何时3 天前
01-06-A-JVM排查实战详解
java·jvm
伞伞悦读3 天前
【第38期】Python 模块与包详解:import、from、模块搜索路径、包结构和 __init__
开发语言·python
vipxieliang3 天前
ValidX 在 DDD 领域驱动设计中的实践
java·spring boot
C语言小火车3 天前
C/C++ 为什么需要编译器?
开发语言·c++