android - 使用 Jack 编译器时禁用 Instant Run

标签 android android-instant-run android-jack-and-jill

我在 gradle 中收到这条消息:

Instant Run is disabled when Jack compiler is used

我的编译时间太长了。

3:54:11 PM Gradle build finished with 1 warnings(s) in 17m 15s 937ms 

我认为是因为这条消息。

我在离线模式下工作。

我的 Gradle :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion '24.0.0'

    defaultConfig {
        applicationId "*.*.*"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        jackOptions {
            enabled true
        }
        // Enabling multidex support.
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    dexOptions {
        javaMaxHeapSize "4g"
        incremental false
        preDexLibraries = false
    }
}
repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
    maven { url 'https://raw.github.com/felipecsl/m2repository/master' }
    maven { url "https://jitpack.io" }
    mavenCentral()

}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile('com.github.florent37:materialviewpager:1.2.0@aar') {
        transitive = true
    }
    compile files('libs/volley.jar')
    compile files('libs/gson-2.2.4.jar')
    compile files('libs/AndroidViewAnimations-1.1.3.jar')
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:recyclerview-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:cardview-v7:23.+'
    compile 'com.android.support:support-v4:23.2.1'
    compile 'com.mohamadamin:persianmaterialdatetimepicker:1.2.1'
    compile 'com.pacioianu.david:ink-page-indicator:1.1.1'
    compile 'com.github.carlonzo.stikkyheader:core:0.0.3-SNAPSHOT'
    compile 'com.alexvasilkov:foldable-layout:1.2.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.alexvasilkov:android-commons:1.2.4'
    compile 'com.melnykov:floatingactionbutton:1.0.7'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.github.ksoichiro:android-observablescrollview:1.5.0'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.github.FuckBoilerplate:RxPaparazzo:0.1.0'
    compile 'io.reactivex:rxjava:1.1.5'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'cn.pedant.sweetalert:library:1.3'
    compile 'com.google.android.gms:play-services-maps:9.4.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
    testCompile 'junit:junit:4.12'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.github.chrisbanes:PhotoView:1.3.0'
    compile 'com.google.android.gms:play-services-location:9.4.0'
    compile 'com.akexorcist:googledirectionlibrary:1.0.4'
}

最佳答案

这是一个已知问题。据报道here

Instant Run does not currently work with Jack and will be disabled while using the new toolchain

在这里查看我的答案 AndroidStudio is too slow看看是否可以加快构建时间

关于android - 使用 Jack 编译器时禁用 Instant Run,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40360053/

相关文章:

java - 如何解决 `jack.import.type.policy` 的区域设置问题?

java - Retrofit2 和 converter-gson : Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

android - Firebase 中的对象版本控制

android - 在 GridView 中加载异步图像 (Android)

android - 即时运行 - Android工作室

java - 尝试在 Android Studio 中运行项目时 InstantRunNotificationTask 出现 NullPointerException

android - Instant Run - 热交换、温交换和冷交换之间的区别

Android mapbox 库非常大

android - 使用JACK时生成的proguard mappings.txt文件在哪里?