Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

routeMap.json 生成错误,编译报错,版本:1.2.3 #220

Open
zhouhaoo opened this issue Dec 9, 2024 · 2 comments
Open

routeMap.json 生成错误,编译报错,版本:1.2.3 #220

zhouhaoo opened this issue Dec 9, 2024 · 2 comments

Comments

@zhouhaoo
Copy link

zhouhaoo commented Dec 9, 2024

修改了activity类名后,rebuild错误。debug = false好像无效,日志还是显示增量编译。checkRouteMap = "delete"后,也没有重新生成。

配置:

studio版本:Android Studio Ladybug | 2024.2.1 Patch 2
agp = "8.7.2"
kotlin = "2.1.0"
插件使用cn.therouter.agp8:1.2.3

plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.kotlin.android)
    alias(libs.plugins.kotlin.serialization)
    alias(libs.plugins.ksp)
    id("therouter")
    id("org.jetbrains.kotlin.kapt")
}
TheRouter {
    debug = false
    checkRouteMap = "delete"
}
dependencies {
    ksp(libs.theRouter.apt)
    implementation(libs.theRouter.router)
}

日志:

> Task :app:TheRouterDebug FAILED
TheRouter编译插件:cn.therouter:plugin:1.2.3
JDK Version::17.0.13
Gradle Version::8.9
本次是增量编译::true
checkRouteMap::delete
checkFlowDepend::
----------------------TheRouter build start------------------------------
---------TheRouter delete route map------------------------------------------

Execution failed for task ':app:TheRouterDebug'.
> Multiple Activity to single Url: com.xxxx.ui.Start2Activity and com.xxxxx.ui.StartActivity

此时routeMap.json为空。clear也无效,但是重启项目后 重新rebuild后正常。

description修改问题

另外只修改一下Router注解的description,在routeMap.json 中会生成两个一样的,只是description不一样。

@AmoryPepelu
Copy link

删掉 routeMap.json 重新编译就行了

@zhouhaoo
Copy link
Author

删掉 routeMap.json 重新编译就行了

删掉 routeMap.json 重新编译会出现两条数据,

{
    "path": "/app/search",
    "className": "com.lxxxx.SearchActivity",
    "action": "",
    "description": "",
    "params": {}
  },
  {
    "path": "/app/search",
    "className": "com.lxxxx.SearchActivity",
    "action": "",
    "description": "",
    "params": {
      "needLogin": "true"
    }
  }

另外你看我上面的配置: debug = false 但是日志还是输出增量编译。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants