簡體   English   中英

進程'command'/ Applications / Android Studio 3.0.1.app/Contents/jre/jdk/Contents/Home/bin/java''完成,退出值非零

[英]Process 'command '/Applications/Android Studio 3.0.1.app/Contents/jre/jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

當我使用android studio導入項目時遇到一個問題。

Error:Execution failed for task ':app:transformClassesWithDexForArmDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
```

And the Gradle console show the following message:

---------
Executing tasks: [:app:assembleArmDebug]
Configuration on demand is an incubating feature.
:app:copyJniLibsArmDebugMainJniLibs UP-TO-DATE
:app:armDebug UP-TO-DATE
:app:preBuild UP-TO-DATE
:app:preArmDebugBuild UP-TO-DATE
:app:checkArmDebugManifest
:app:preArmReleaseBuild UP-TO-DATE
:app:prepareCjtLibraryWheelCamera019Library UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2531Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72531Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72531Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2531Library UP-TO-DATE
:app:preArmDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72531Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2531Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2531Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2531Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2531Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2531Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42531Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2531Library UP-TO-DATE
:app:prepareComAndroidSupportTransition2531Library UP-TO-DATE
:app:prepareComBlankjUtilcode134Library UP-TO-DATE
:app:prepareComCjjMaterialrefeshlayoutLibrary130Library UP-TO-DATE
:app:prepareComDaimajiaAndroidanimationsLibrary113Library UP-TO-DATE
:app:prepareComDaimajiaEasingLibrary101Library UP-TO-DATE
:app:prepareComDanikulaVideocache264Library UP-TO-DATE
:app:prepareComDevbracketsAndroidExomedia301Library UP-TO-DATE
:app:prepareComEdmodoCropper101Library UP-TO-DATE
:app:prepareComFlycoTablayoutFlycoTabLayout_Lib212Library UP-TO-DATE
:app:prepareComGetbaseFloatingactionbutton1101Library UP-TO-DATE
:app:prepareComGithubChrisbanesPhotoView130Library UP-TO-DATE
:app:prepareComGithubCtiaoDanmakuFlameMaster0912Library UP-TO-DATE
:app:prepareComGithubJmolsmobileLandscapevideocamera107Library UP-TO-DATE
:app:prepareComGithubSatyanSugar15Library UP-TO-DATE
:app:prepareComGoogleAndroidExoplayerExoplayerR159Library UP-TO-DATE
:app:prepareComJaydenxiaoGuider100Library UP-TO-DATE
:app:prepareComJcodecraeerXrecyclerview132Library UP-TO-DATE
:app:prepareComMakeramenRoundedimageview230Library UP-TO-DATE
:app:prepareComMalinskiySuperrecyclerview114Library UP-TO-DATE
:app:prepareComOrhanobutLogger115Library UP-TO-DATE
:app:prepareComPgyersdkSdk254Library UP-TO-DATE
:app:prepareComPingxxPingppAlipay218Library UP-TO-DATE
:app:prepareComPingxxPingppCore218Library UP-TO-DATE
:app:prepareComPingxxPingppWxpay218Library UP-TO-DATE
:app:prepareComRengwuxianMaterialedittextLibrary214Library UP-TO-DATE
:app:prepareComScwangSmartrefreshSmartRefreshHeader103Library UP-TO-DATE
:app:prepareComScwangSmartrefreshSmartRefreshLayout103Library UP-TO-DATE
:app:prepareComSerenegiantCommon119Library UP-TO-DATE
:app:prepareComZhyOkhttputils262Library UP-TO-DATE
:app:prepareDeHdodenhofCircleimageview210Library UP-TO-DATE
:app:prepareJpWasabeefGlideTransformations202Library UP-TO-DATE
:app:preparePubDevrelEasypermissions020Library UP-TO-DATE
:app:prepareArmDebugDependencies
:app:compileArmDebugAidl UP-TO-DATE
:app:compileArmDebugRenderscript UP-TO-DATE
:app:generateArmDebugBuildConfig UP-TO-DATE
:app:generateArmDebugAssets UP-TO-DATE
:app:mergeArmDebugAssets UP-TO-DATE
:app:generateArmDebugResValues UP-TO-DATE
:app:generateArmDebugResources UP-TO-DATE
:app:mergeArmDebugResources UP-TO-DATE
:app:processArmDebugManifest UP-TO-DATE
:app:processArmDebugResources UP-TO-DATE
:app:generateArmDebugSources UP-TO-DATE
:app:compileArmDebugJavaWithJavac UP-TO-DATE
:app:compileArmDebugSources UP-TO-DATE
:app:transformClassesWithJarMergingForArmDebug UP-TO-DATE
:app:collectArmDebugMultiDexComponents UP-TO-DATE
:app:transformClassesWithMultidexlistForArmDebug UP-TO-DATE
:app:transformClassesWithDexForArmDebug

解析錯誤:

unsupported class file version 52.0
...while parsing com/a/a/a.class
PARSE ERROR:
unsupported class file version 52.0
...while parsing com/a/a/b.class
2 errors; aborting
 FAILED

    FAILURE: Build failed with an exception.
    * What went wrong:

Execution failed for task ':app:transformClassesWithDexForArmDebug'.

com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:處理'command'/Library/Java/JavaVirtualMachines/jdk1.8.0_161。 jdk / Contents / Home / bin / java''使用非零退出值1完成*嘗試:使用--stacktrace選項運行以獲取堆棧跟蹤。 使用--info或--debug選項運行以獲取更多日志輸出。 失敗總時間:39.744秒


這個android項目可以在另一台計算機上很好地運行,但是不能在當前計算機上運行。我希望您能幫助我解決此問題或給我一些建議,在此先感謝您。

嘗試將這段代碼添加到build.gradle> android

dexOptions {
    javaMaxHeapSize "4g"
}

此錯誤與com.google.firebase和com.google.android.gms依賴關系有關。

將它們升級到最新版本,該問題將得到解決。

使用以下命令更新您的Project build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
}

並將gradle文件中的所有com.google.firebasecom.google.android.gms更新為更高版本。

我只是遇到了同樣的問題。 我的解決辦法是:

"build > Clean project"
"build > Generate signed APK"

然后構建成功。

我在mij build.gradle文件中也設置了dexOptions。

dexOptions {
    javaMaxHeapSize "4g"
}

也許您在AndroidStudio中使用Camel案例名稱制作了一個新軟件包。 有時會使崩潰和問題歸零。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM