Android -Arouter使用说明
16lz
2021-01-23
1.
app 中 build.gradle中配置
如下
apply plugin: 'com.android.application'android { compileSdkVersion 27 buildToolsVersion "27.0.3" defaultConfig { applicationId "com.xutil.xxxx" minSdkVersion 15 targetSdkVersion 27 versionCode 1 versionName "1.0" javaCompileOptions{ annotationProcessorOptions { arguments = [AROUTER_MODULE_NAME: project.getName()] } } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }}allprojects { repositories { jcenter() maven { url "https://maven.google.com" } }}dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:27.+' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' compile 'com.alibaba:arouter-api:1.4.0' annotationProcessor 'com.alibaba:arouter-compiler:1.2.1'}
2.主项目的 build.gradle配置如下
apply plugin: 'com.alibaba.arouter'buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.2' // classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' classpath 'com.alibaba:arouter-register:1.0.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}allprojects { repositories { google() jcenter() }}task clean(type: Delete) { delete rootProject.buildDir}
3.官方链接
https://github.com/alibaba/ARouter
更多相关文章
- Android系列教程之四:Android项目的目录结构
- 【Android Studio使用教程1】Android Studio导入项目的几种方法
- Android 近百个项目的源代码,覆盖Android开发的每个领域
- 使用 VSCode 编写 .NET Core 项目的实例教程
- C#之FastSocket实战项目的示例分享
- 阅读优秀 Python 开源项目的代码,提升编程技能(GitHub 资源帖推荐)
- 非功能性需求,不要成为项目的坑
- 使用jquery tablesorter插件,有一个选中项目的下拉框
- 绑定和解除相同javascript函数的目的是什么?