繁体   English   中英

Realm和jackOptions Java以非零退出值1完成-Android Gradle

[英]Realm and jackOptions Java finished with non-zero exit value 1 - Android Gradle

升级到Android设计工具24后,我的项目将不再运行。 它构建良好,没有任何错误,但是当我运行它时,我得到了错误:

错误:等级:任务':app:transformClassesWithDexForDebug'的执行失败。

com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:Process'command'C:\\ Program Files \\ Java \\ jdk1.8.0_102 \\ bin \\ java.exe''以非零退出值1结束

这是我的build.gradle文件:

apply plugin: 'com.android.application'

apply plugin: 'realm-android'

android {

compileSdkVersion 24
buildToolsVersion "24.0.2"

defaultConfig {
    applicationId "com.example.don.mstp"
    minSdkVersion 15
    targetSdkVersion 24
    versionCode 1
    versionName "1.0"
    // Enabling multidex support.
    multiDexEnabled true
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}


buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
dexOptions {
    incremental true
    javaMaxHeapSize "4g"
    preDexLibraries = false
}


}

dependencies {

compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.github.Lukle:ClickableAreasImages:v0.1'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.android.support:cardview-v7:24.2.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.github.javiersantos:MaterialstyledDialogs:1.3'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.6'
compile 'com.ramotion.foldingcell:folding-cell:1.0.1'
compile 'com.github.brnunes:swipeablerecyclerview:1.0.2'
compile 'com.github.gabrielemariotti.recyclerview:recyclerview-animators:0.3.0-SNAPSHOT@aar'
compile 'com.tiancaicc.springfloatingactionmenu:library:0.0.2'
compile 'com.daimajia.numberprogressbar:library:1.2@aar'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.daprlabs.aaron:cardstack:0.3.0'
compile 'com.txusballesteros:FitChart:1.0'
compile 'com.github.SilenceDut:ExpandableLayout:v1.0.1'

}

我终于让我的项目开始运行,这是这样的:

显然,目前无法在Realm中使用Jack编译器,因为Jack不支持字节码操作(Javassist / Transform API)。 话虽如此,但是我们现在可以使用'retrolambda'并删除jackOptions。

在您的build.gradle中

apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'realm-android'

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
}

在项目主gradle中添加类路径:

 dependencies {
        classpath 'io.realm:realm-gradle-plugin:0.88.3'
        classpath 'me.tatarka:gradle-retrolambda:3.2.5'

    }

这又使我的项目再次运行。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM