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

 

更多相关文章

  1. Android系列教程之四:Android项目的目录结构
  2. 【Android Studio使用教程1】Android Studio导入项目的几种方法
  3. Android 近百个项目的源代码,覆盖Android开发的每个领域
  4. 使用 VSCode 编写 .NET Core 项目的实例教程
  5. C#之FastSocket实战项目的示例分享
  6. 阅读优秀 Python 开源项目的代码,提升编程技能(GitHub 资源帖推荐)
  7. 非功能性需求,不要成为项目的坑
  8. 使用jquery tablesorter插件,有一个选中项目的下拉框
  9. 绑定和解除相同javascript函数的目的是什么?

随机推荐

  1. Android(安卓)4.0后,自定义Title报错 You
  2. Android(安卓)全屏设置
  3. Android(安卓)keytool 生成证书MD5指纹
  4. Android(安卓)应用指定浏览器开发实例
  5. TableLayout
  6. android 用UDP做的心跳连接 小示例
  7. android 圆环图形的实现
  8. Android中蓝牙使用步骤小结
  9. android获取手机中的短信和,android获取
  10. Android(安卓)中文API (66) —— Bluetooth