Android 长梯度构建时间

Android 长梯度构建时间,android,android-gradle-plugin,Android,Android Gradle Plugin,这是一个10mb的应用程序,没什么复杂的。我无法想象为什么每次构建需要2-3分钟。我按照这里的指示: 我有Firebase Analytics、Performance和Crashlytics的基本实现。正如你所看到的,谷歌只是appcompat和constraint。除unity ads外,其他依赖项目前看起来不错(正在使用) 有什么想法吗?谢谢 APP BUILD.GRADLE buildscript { repositories { maven { url 'http

这是一个10mb的应用程序,没什么复杂的。我无法想象为什么每次构建需要2-3分钟。我按照这里的指示:

我有Firebase Analytics、Performance和Crashlytics的基本实现。正如你所看到的,谷歌只是appcompat和constraint。除unity ads外,其他依赖项目前看起来不错(正在使用)

有什么想法吗?谢谢

APP BUILD.GRADLE

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.25.4'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'realm-android'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "zdkapps.com.kingdomtrader"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 7
        versionName "0.0.7"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

repositories {
    maven {
        //url 'https://github.com/uPhyca/stetho-realm/raw/master/maven-repo'
         url 'https://github.com/WickeDev/stetho-realm/raw/master/maven-repo'
    }
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    implementation 'me.grantland:autofittextview:0.2.0'
    implementation 'com.akexorcist:RoundCornerProgressBar:2.0.3'
    implementation 'com.pnikosis:materialish-progress:1.7'
    implementation 'net.steamcrafted:materialiconlib:1.0.8'
    implementation 'com.daasuu:animateHorizontalProgressBar:0.2.3'
    implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
    implementation project(':tourguide')
    implementation 'com.google.firebase:firebase-core:12.0.1'
    implementation 'com.google.firebase:firebase-crash:12.0.1'
    implementation 'com.google.firebase:firebase-ads:12.0.1'
    implementation 'com.google.firebase:firebase-messaging:12.0.1'
    implementation project(':unity-ads')
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.facebook.stetho:stetho:1.5.0'
    implementation 'com.uphyca:stetho_realm:2.2.2'
    implementation 'com.uphyca:stetho_realm:2.1.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.firebase:firebase-perf:12.0.1'
}

apply plugin: 'com.google.gms.google-services'
BUILD.GRADLE:

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

buildscript {
    repositories {
        jcenter()
        google()
        maven { url "https://jitpack.io" }
        maven {
            url 'https://maven.fabric.io/public'
        }

        mavenCentral()
        maven(){
            url "https://oss.sonatype.org/content/repositories/snapshots"
            }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.2.0'
        classpath "io.realm:realm-gradle-plugin:5.1.0"
        classpath 'io.fabric.tools:gradle:1.25.1'
        classpath 'com.google.firebase:firebase-plugins:1.1.5'
        // 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" }
        mavenCentral()
        maven(){
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }
        google()
    }
}

检查“全局渐变设置”下的“脱机工作”

它将减少90%的渐变构建时间

试试这个