ARouter之kotlin build.gradle.kts
kotlin的配置需要用到kapt
项目的build.gradle.kts
plugins {id("com.android.application") version "8.1.2" apply falseid("org.jetbrains.kotlin.android") version "1.9.0" apply falseid("org.jetbrains.kotlin.jvm") version "1.9.0" apply falseid("org.jetbrains.kotlin.kapt") version "1.9.0" apply falseid("com.android.library") version "8.1.2" apply false
}
app的build.gradle.kts
plugins {id("com.android.application")id("org.jetbrains.kotlin.android")id("org.jetbrains.kotlin.kapt")
}
kapt {arguments {arg("AROUTER_MODULE_NAME", project.name)}
}
dependencies {//ARouterimplementation(Libs.arouter_api)kapt(Libs.arouter_compiler)}
ARouter版本
val arouter_api = "1.5.2"val arouter_api = "com.alibaba:arouter-api:${arouter_api}"val arouter_compiler = "com.alibaba:arouter-compiler:${arouter_api}"
需要注意的是 如果都多个Module都需要用到ARouter 那么在每一个module下都需要和app build.gradle.kts一样的配置
配置了对应的路径执行跳转时候报错
There is no route match the path [/xxx/xxx], in group [xxx][ ]
解决方法:
修改项目的versionCode 和versionName 重新编译就好了