MaterialDrawer庫的Gradle配置

環境:

win7系統

Android studio版本2.3.3


關鍵點:

1、在Project的gradle文件中添加 

maven { url "https://maven.google.com" }

2、可能要在AS的菜單"File->Setting“中設置代理。 

幾個Activity,正常的Gradle Build時間,應在1分多鐘。


Project的build.gradle文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath "io.realm:realm-gradle-plugin:3.7.2"
        classpath 'com.novoda:bintray-release:0.3.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://jitpack.io' }
        maven { url "https://maven.google.com" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

App的build.gradle文件:

apply plugin: 'com.android.application'
apply plugin: 'realm-android'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.2"
    defaultConfig {
        applicationId "com.foxmail.yusp75.myexam"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true
        //testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            //  application

            versionNameSuffix 'MyExam'
        }
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            //  application

            versionNameSuffix 'MyExam'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
        exclude module: 'jsr305'
    })
    compile 'com.android.support:support-v4:26.0.0-alpha1'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.android.support:support-annotations:26.0.0-alpha1'
    compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
    compile 'com.android.support:support-vector-drawable:26.0.0-alpha1'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile('com.mikepenz:materialdrawer:5.9.5@aar') {
        transitive = true
    }

    testCompile 'junit:junit:4.12'
    compile project(':FileChooser')

}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章