吴富其

Results 18 comments of 吴富其

2. 替换 v4、v7包。替换成androidx (support包主要在arouter-api中) 替换掉build.gradle下面的依赖 ![image](https://user-images.githubusercontent.com/23232556/124453004-841b4500-ddb9-11eb-9df8-639a93ede822.png) ![image](https://user-images.githubusercontent.com/23232556/124453339-db211a00-ddb9-11eb-99df-66b12cf6d09c.png) ![image](https://user-images.githubusercontent.com/23232556/124453378-e5431880-ddb9-11eb-8e81-e50e411939d3.png) 替换成 androidx ![image](https://user-images.githubusercontent.com/23232556/124453502-03a91400-ddba-11eb-8612-4c581782654f.png) ![image](https://user-images.githubusercontent.com/23232556/124453561-14598a00-ddba-11eb-9576-ee0a9e2aaf43.png)

![image](https://user-images.githubusercontent.com/23232556/124453690-34894900-ddba-11eb-9806-2627ed8971e9.png) 替换成 androidx ![image](https://user-images.githubusercontent.com/23232556/124453782-4bc83680-ddba-11eb-9f09-5b9526249eb2.png)

arouter-compiler下的Consts.java ![image](https://user-images.githubusercontent.com/23232556/124454087-a5c8fc00-ddba-11eb-81e6-74f6571d500e.png) 替换成 androidx ![image](https://user-images.githubusercontent.com/23232556/124454306-ec1e5b00-ddba-11eb-8d48-6e33b4c5bcf9.png)

arouter-api build.gradle 配置: ![image](https://user-images.githubusercontent.com/23232556/124454591-3ef81280-ddbb-11eb-9c5b-7b919dc2cd80.png)

arouter-annotation build.gradle 配置: ![image](https://user-images.githubusercontent.com/23232556/124454718-5e8f3b00-ddbb-11eb-98b2-6fa34d617c4b.png)

arouter-compiler build.gradle 配置: ![image](https://user-images.githubusercontent.com/23232556/124454826-7666bf00-ddbb-11eb-959a-9b08519b16f8.png)

首先我声明一点 在导入“annotationProcessor”时,不能只写 “project(':arouter-compiler')” ![image](https://user-images.githubusercontent.com/23232556/124455028-b3cb4c80-ddbb-11eb-99e6-2d3fa12abd85.png) 必须要这样写。我也不知道问什么。只知道这样写可以运行。 **求知道原理的大佬在下面进行留言。** 目前我用的 1.4.1版本的路由 所以compiler版本为:1.2.0.(官方源码里对应的版本)

使用时: ![image](https://user-images.githubusercontent.com/23232556/124455474-37853900-ddbc-11eb-98e9-3316e5a8578b.png) ``` annotationProcessor project(':arouter-compiler') annotationProcessor 'com.alibaba:arouter-compiler:1.2.0' api project(':arouter-annotation') ```

目前 测试 androidx 通过运行。 ![image](https://user-images.githubusercontent.com/23232556/124455602-5b487f00-ddbc-11eb-99bd-67b91a7507b8.png) ![image](https://user-images.githubusercontent.com/23232556/124455640-64395080-ddbc-11eb-8fe3-e7e37c9dbed9.png)

![image](https://user-images.githubusercontent.com/23232556/124455730-7915e400-ddbc-11eb-976b-6b75064ed47c.png) ![image](https://user-images.githubusercontent.com/23232556/124455774-87640000-ddbc-11eb-8a8f-10f0ace699f2.png)