杰克编译花了很长时间

2023-12-31

升级我的项目以启用 Jack 和 Java8 功能后,我的 16GB MacBook 似乎无法再构建我的项目。 我看到内存使用量越来越高,但进程总是卡在同一点。

我的 Gradle 控制台:

Executing tasks: [:app:assembleDebug]

Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2421Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72421Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72421Library UP-TO-DATE
:app:prepareComAndroidSupportCustomtabs2340Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2421Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2421Library UP-TO-DATE
:app:prepareComBluelinelabsConductor203Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk4160Library UP-TO-DATE
:app:prepareComGithubJkwiecienEasyImage130Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuth940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAuthBase940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement940Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalytics940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAnalyticsImpl940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuth940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthCommon940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseAuthModule940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCommon940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseCore940Library UP-TO-DATE
:app:prepareComGoogleFirebaseFirebaseIid940Library UP-TO-DATE
:app:prepareComHannesdorfmannMosbyMvp201Library UP-TO-DATE
:app:prepareComHannesdorfmannMosbyMvpConductor082Library UP-TO-DATE
:app:prepareComHannesdorfmannMosbyViewstate201Library UP-TO-DATE
:app:prepareComHannesdorfmannMosbyViewstateConductor082Library UP-TO-DATE
:app:prepareComJakewhartonButterknife840Library UP-TO-DATE
:app:prepareComJakewhartonRxbindingRxbinding040Library UP-TO-DATE
:app:prepareComJakewhartonRxbindingRxbindingAppcompatV7040Library UP-TO-DATE
:app:prepareComJakewhartonRxbindingRxbindingDesign040Library UP-TO-DATE
:app:prepareComJakewhartonRxbindingRxbindingRecyclerviewV7040Library UP-TO-DATE
:app:prepareComJakewhartonRxbindingRxbindingSupportV4040Library UP-TO-DATE
:app:prepareComJakewhartonTimberTimber431Library UP-TO-DATE
:app:prepareComKelvinappsRxfirebase0015Library UP-TO-DATE
:app:prepareComSquareupLeakcanaryLeakcanaryAndroid14Library UP-TO-DATE
:app:prepareIoReactivexRxandroid121Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:processDebugGoogleServices
Parsing json file: /Users/leonardo/AndroidStudioProjects/Kluster/app/google-services.json
:app:generateDebugResources
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources
:app:generateDebugSources
:app:unzipJacocoAgent
:app:transformClassesWithPreJackPackagedLibrariesForDebug
:app:transformClassesWithPreJackRuntimeLibrariesForDebug

我的构建:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "24.0.3"

    dexOptions {
        maxProcessCount 2
        javaMaxHeapSize "2g"
    }

    defaultConfig {

        jackOptions {
            enabled = true
        }

        applicationId "com.kluster"
        minSdkVersion 16
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])


    compile 'com.facebook.stetho:stetho:1.3.1'
    compile rootProject.ext.supportV4
    compile rootProject.ext.supportDesign
    compile rootProject.ext.supportAnnotations
    compile rootProject.ext.supportAppCompat
    compile rootProject.ext.supportRecyclerView
    compile rootProject.ext.supportCardview
    compile(rootProject.ext.butterknife)
            {
                exclude group: "com.android.support"
            }
    compile rootProject.ext.conductor

    compile(rootProject.ext.easyImage) {
        exclude group: "com.android.support"
    }

    compile rootProject.ext.glide
    compile rootProject.ext.dagger
    compile rootProject.ext.rxJava
    compile rootProject.ext.rxAndroid
    compile rootProject.ext.mosby
    compile rootProject.ext.mosbyViewState
    compile rootProject.ext.mosbyConductor
    compile rootProject.ext.mosbyViewStateConductor
    compile rootProject.ext.rxBinding
    compile rootProject.ext.rxBindingV4
    compile rootProject.ext.rxBindingV7
    compile rootProject.ext.rxBindingDesign
    compile rootProject.ext.rxBindingRecyclerView
    debugCompile rootProject.ext.leakCanary
    compile rootProject.ext.timber

    compile rootProject.ext.firebaseAuth;
    compile rootProject.ext.googleAuth
    compile rootProject.ext.rxFirebase
    compile rootProject.ext.facebook

    provided rootProject.ext.butterknifeCompiler
    provided rootProject.ext.daggerCompiler
    provided rootProject.ext.javaxAnnotation

    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:24.2.1'
    testCompile 'junit:junit:4.12'
}

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

gradle.属性:

# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

在使用 Jack 之前,编译器将在不到 20 秒左右的时间内构建,可能出了什么问题? 谢谢


好像这已经是分类确认为“严重”错误 https://code.google.com/p/android/issues/detail?id=203168希望“2.4”Gradle 插件能为我们带来更快的构建时间:)

这并不是说这可能会产生重大影响,但请尝试更新应用程序的build.gradle与以下

android {
   .
   .
   .


  defaultConfig {

    .
    .
    .
    .
    jackOptions {
            enabled true
            additionalParameters('jack.incremental': 'true')
    }
    .
    .
  }

  dexOptions {
        javaMaxHeapSize '4096m'
  }

  compileOptions {
    incremental true
    .
    .
    .
  }
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

杰克编译花了很长时间 的相关文章

随机推荐

  • 将 nginx.conf 添加到 Kubernetes 集群

    我怎样才能通过nginx conf配置文件到 Kubernetes 集群内运行的 nginx 实例 您可以创建一个 ConfigMap 对象 然后将值作为文件安装在您需要的位置 apiVersion v1 kind ConfigMap me
  • 说明:register_shutdown_function [关闭]

    很难说出这里问的是什么 这个问题是含糊的 模糊的 不完整的 过于宽泛的或修辞性的 无法以目前的形式得到合理的回答 如需帮助澄清此问题以便重新打开 访问帮助中心 help reopen questions 什么是register shutdo
  • 我已经被 async/await 宠坏了!现在正在努力解决明确的任务延续问题

    编辑 接受后 它可能不会立即显而易见 但 Servy 的答案是正确的 不需要自定义实现Unwrap在 monodroid 下 在我的评论中我说它不存在 但它确实存在 End edit 我正在编写一堆使用我们的 RESTful Web 服务的
  • Pytesseract - 使用用户模式

    我正在尝试将 tesseract 的用户模式与 pytesseract 一起使用 但似乎无法使该命令正常工作 这看起来应该相当简单 但文档很少 我使用的是 tesseract 3 05 01 这样做是行不通的 pytesseract ima
  • 在 Vim 中更改大小写

    Vim 中是否有命令可以更改所选文本的大小写 Visual select the text http vimdoc sourceforge net htmldoc visual html visual use then U for uppe
  • Python程序遍历目录并读取文件信息

    我刚刚开始使用 Python 但已经发现它比 Bash shell 脚本更加高效 我正在尝试编写一个 Python 脚本 该脚本将遍历从我启动脚本的目录分支的每个目录 并且对于它遇到的每个文件 加载此类的实例 class FileInfo
  • 我在颤振中遇到空安全问题

    我在 Flutter 中遇到空安全问题 我想将数据放入其中水平数据表 https pub dev packages horizontal data table在 Flutter 中 我用StreamBuilder但是当我在小部件内调用它时
  • Boost.Python.ArgumentError:python str 未转换为 std::string

    我收到一个错误 我无法理解尝试通过 Boost Python 包装一个相当简单的 C 类的意义 一 班级 include
  • 使用指令以驼峰命名法设置元素的属性值

    我正在尝试从这样的指令向 angularJs 元素添加属性 element attr startOffset val 但是当我检查该元素时 添加的属性是 startoffset 其中 o 不是大写字母 有什么方法可以向元素添加属性并保持单词
  • Django ORM原始删除查询不删除记录

    我在用raw sql为了方便我的查询以保持数据库最小化 我正在删除额外的记录 通过这个查询 d is from a loop and has values res MyModel objects raw DELETE FROM mydb m
  • JQuery Ajax 投票

    我正在用这个JQuery Ajax 投票系统指南 http ad1987 blogspot com 2009 02 reddit style voting with php mysql and html作为一个粗略的参考 但我对此的安全性有
  • 如何为 Risc-V(汇编语言)编写旋转操作 我们有像 8086 中那样的命令吗?

    我以前使用过8086的汇编语言 8086中的旋转操作只是一个命令 但我在 Risc V 汇编语言中找不到旋转操作的特定关键字 看起来扩展 B 最终应该定义这样的指令 在那之前你必须使用左移和右移来组合它 这是 MIPS32R2 rotrv
  • 如何从资源中播放WAV音频文件?

    如何从我的项目资源中播放 WAV 音频文件 我的项目是 C 中的 Windows 窗体应用程序 Because mySoundFile is a Stream 你可以利用SoundPlayer的重载构造函数 它接受Stream object
  • 什么是 RWS Monad 以及何时使用它

    我在 mtl 库中查找某些内容时遇到了 RWS Monad 及其 MonadTransformer 那里没有真正的文档 我想知道这是什么以及它在哪里使用 我发现 RWS 是 Reader Writer State 的缩写 它是这三个 mon
  • SELECT ... *FOR UPDATE* 的目的是什么?

    我很困惑你为什么要指定FOR UPDATE 为什么数据库关心你要如何处理来自SELECT 编辑 抱歉 我问的问题很糟糕 我知道文档说它将事情变成 锁定读取 我想知道的是 在哪些情况下 可观察的行为在指定之间会有所不同 FOR UPDATE并
  • 如何在Java中格式化时间间隔?

    我创建 J2SE 应用程序 该应用程序需要将两次以毫秒为单位的时间格式化为表示这两次时间之间间隔的字符串 long time1 1334331041677L Fri Apr 13 17 30 41 CEST 2012 long time2
  • 异步函数调用C++0x

    我正在使用以下代码测试 std async 函数http www justsoftwaresolutions co uk threading multithreading in c 0x part 8 futures and promise
  • WIndows API 中的“L”和“LPCWSTR”

    我发现 NetUserChangePassword 0 0 L ab L cd 将用户密码从 ab 更改为 cd 然而 NetUserChangePassword 0 0 LPCWSTR ab LPCWSTR cd 不起作用 返回值表示密码
  • 什么是“ANSI_X3.4-1968”编码?

    在我的系统上查看以下输出 STEP 101 python3 c import sys print sys stdout encoding ANSI X3 4 1968 STEP 102 STEP 103 locale LANG C LANG
  • 杰克编译花了很长时间

    升级我的项目以启用 Jack 和 Java8 功能后 我的 16GB MacBook 似乎无法再构建我的项目 我看到内存使用量越来越高 但进程总是卡在同一点 我的 Gradle 控制台 Executing tasks app assembl