ARouter::There is no route match the path

ARouter:https://github.com/alibaba/ARouter
在使用服务时会提示找不到路由路径,但是已经按照官网提示的配置好了路径。
原因:可能是配置出现问题。

在模块化开发时需要在各个模块的build.gradle里都要配置

defaultConfig {
        ...

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [moduleName: project.getName()]
            }
        }

    }


dependencies {
    ...

    annotationProcessor 'com.alibaba:arouter-compiler:1.1.4'
    implementation project(':base')//base模块里添加依赖

}

同时base模块里

dependencies {
   ...
    compile ('com.alibaba:arouter-api:1.3.1'){ exclude group: 'com.android.support' }
//    implementation 'com.alibaba:arouter-api:1.3.1'

}

注意:导入arouter-api时可能出现V4包版本不一致,如下异常,所以将其屏蔽

Error:Execution failed for task ':app:preDebugBuild'.
> Android dependency 'com.android.support:support-v4' has different version for the compile (25.2.0) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution

虽然编译没有问题,但是在运行时可能出现异常

com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lcom/alibaba/android/arouter/routes/ARouter$$Group$$user;

解决方法:https://blog.csdn.net/baidu_21345205/article/details/80360014









评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值