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

相关推荐
甲枫叶1 小时前
【claude】Claude Code正式引入Git Worktree原生支持:Agent全面实现并行独立工作
java·人工智能·git·python·ai编程
六件套是我1 小时前
无法访问org.springframeword.beans.factory.annotation.Value
java·开发语言·spring boot
LYS_06182 小时前
C++学习(5)(函数 指针 引用)
java·c++·算法
S-码农2 小时前
Linux ——条件变量
linux·开发语言
清水白石0082 小时前
《Python 编程全景解析:从核心精要到 Hypothesis 属性基测试的边界探索》
开发语言·python
forestsea2 小时前
Spring Cloud Alibaba 2025.1.0.0 正式发布:拥抱 Spring Boot 4.0 与 Java 21+ 的新时代
java·spring boot·后端
IT枫斗者2 小时前
IntelliJ IDEA 2025.3史诗级更新:统一发行版+Spring Boot 4支持,这更新太香了!
java·开发语言·前端·javascript·spring boot·后端·intellij-idea
forestsea2 小时前
Spring Boot 4.0 + JDK 25 + GraalVM:下一代云原生Java应用架构
java·spring boot·云原生
♡喜欢做梦2 小时前
Spring Boot 日志实战:级别、持久化与 SLF4J 配置全指南
java·spring boot·后端·spring·java-ee·log4j