簡體   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