gpt4 book ai didi

android - java.exe 以非退出值 2 结束

转载 作者:行者123 更新时间:2023-11-29 14:46:37 25 4
gpt4 key购买 nike

当我尝试运行我的应用程序时,出现以下错误:

    Error:Execution failed for task ':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_25\bin\java.exe'' finished with non-zero exit value 2

我曾尝试在多个论坛中进行搜索,但大多数与此问题相关的解决方案似乎都因具体情况而异,没有一个解决方案适合我。

下面是我的messages gradle build中的信息:

    Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:libraries:tess-two:preBuild UP-TO-DATE
:libraries:tess-two:preReleaseBuild UP-TO-DATE
:libraries:tess-two:compileReleaseNdk UP-TO-DATE
:libraries:tess-two:compileLint
:libraries:tess-two:copyReleaseLint UP-TO-DATE
:libraries:tess-two:mergeReleaseProguardFiles UP-TO-DATE
:libraries:tess-two:packageReleaseRenderscript UP-TO-DATE
:libraries:tess-two:checkReleaseManifest
:libraries:tess-two:prepareReleaseDependencies
:libraries:tess-two:compileReleaseRenderscript UP-TO-DATE
:libraries:tess-two:generateReleaseResValues UP-TO-DATE
:libraries:tess-two:generateReleaseResources UP-TO-DATE
:libraries:tess-two:packageReleaseResources UP-TO-DATE
:libraries:tess-two:compileReleaseAidl UP-TO-DATE
:libraries:tess-two:generateReleaseBuildConfig UP-TO-DATE
:libraries:tess-two:generateReleaseAssets UP-TO-DATE
:libraries:tess-two:mergeReleaseAssets UP-TO-DATE
:libraries:tess-two:processReleaseManifest UP-TO-DATE
:libraries:tess-two:processReleaseResources UP-TO-DATE
:libraries:tess-two:generateReleaseSources UP-TO-DATE
:libraries:tess-two:compileReleaseJavaWithJavac UP-TO-DATE
:libraries:tess-two:processReleaseJavaRes UP-TO-DATE
:libraries:tess-two:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:libraries:tess-two:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:libraries:tess-two:mergeReleaseJniLibFolders UP-TO-DATE
:libraries:tess-two:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:libraries:tess-two:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:libraries:tess-two:bundleRelease UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2311Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72311Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidAnswers136Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidBeta114Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlytics255Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore238Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlyticsNdk112Library UP-TO-DATE
:app:prepareComProlificinteractiveMaterialCalendarview070Library UP-TO-DATE
:app:prepareContactManagment1512LibrariesTessTwoUnspecifiedLibrary UP-TO-DATE
:app:prepareIoFabricSdkAndroidFabric1310Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:processDebugManifest UP-TO-DATE
:app:fabricGenerateResourcesDebug
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugResources
:app:generateDebugSources
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithDexForDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
Error:Execution failed for task ':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_25\bin\java.exe'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 38.882 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

从我在各种论坛上看到的问题来看,与此相关的问题似乎是由“build.gradle”文件中的冲突引起的,主要是在依赖项下。

我在下面包含了我的应用“build.gradle”文件:

buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}

apply plugin: 'com.android.application'

repositories {
maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'io.fabric'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "com.example.l33902.contactmanagment1512"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

useLibrary 'org.apache.http.legacy'

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.prolificinteractive:material-calendarview:0.7.0'

compile files('libs/json_simple-1.1.jar')
compile files('libs/jtar-1.1.jar')
compile files('libs/microsoft-translator-java-api-0.6-mod.jar')
compile project(':libraries:tess-two')

compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
transitive = true;
}
compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.2@aar') {
transitive = true;
}
crashlytics {
enableNdk true
androidNdkOut 'src/main/obj'
androidNdkLibsOut 'src/main/libs'
}


}

crashlytics {
enableNdk true
androidNdkOut 'src/main/obj'
androidNdkLibsOut 'src/main/libs'
}

我不确定哪里出了问题,如果有任何建议请指出正确的方向。提前致谢!!~

最佳答案

我以前遇到过这个问题。您应该只包含您实际使用的库。

尝试清理您的项目。从 build.gradle 中的依赖项中删除一些未使用的库和方法

或者您可以尝试通过以下方式启用 multidex 支持:

defaultConfig {        
multiDexEnabled true
}

希望对您有所帮助!

关于android - java.exe 以非退出值 2 结束,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34718560/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com