1:生成maven文件
在modlue包下的build.gradle中添加一下代码,并打开Android Studio的命令行,并执行 代码gradlew testa:uploadArchives (testa为module包)
如果成功那么会生成com/example/maventestdemo/aa/**的arr文件
二:在github中建一个新仓库
1:mac cd进入到创建arr的文件夹里 (如果报错那么先拉一下代码git pull origin master )
git init
git remote add origin https://github.com/chenqixin/OkHttp.git
git add *
git commit -m "ddd"
git push -u origin master
三:项目添加添加maven仓库 并导入aar包
(1)复制出仓库当前界面的链接地址 https://github.com/chenqixin/OkHttp 对其进行修改:
https://raw.githubusercontent.com/chenqixin/OkHttp/master 并在项目的build.gradle中配置maven残酷。
(2)在app的build.gradle 中 implementation 'com.example.mavendemo:aa:1.0.0'
网友评论