1

I have some troubles with building a libGDX project on Android. When I choose "Build APK" in Android Studio > Build.

A trouble: Error:Execution failed for task ':android:transformClassesWithDexForRelease'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Android\Android Studio\jre\bin\java.exe'' finished with non-zero exit value 1

What I did: - of course, did a lot of Google; - reinstalled JDK; - tried to change small settings in gradle config; - tried to change SDK;

And nothing of above worked...

So this is my build.gradle:

android {
buildToolsVersion '24.0.3'
compileSdkVersion 24
sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src']
        aidl.srcDirs = ['src']
        renderscript.srcDirs = ['src']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
        jniLibs.srcDirs = ['libs']
    }

    instrumentTest.setRoot('tests')
}
defaultConfig {
    applicationId "com.wlodek.oneman"
    minSdkVersion 8
    targetSdkVersion 24
}
productFlavors {
}
dexOptions {
    incremental true
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
    buildType {
        debuggable false
        jniDebuggable false
    }
}
hypeofpipe
  • 503
  • 4
  • 16
  • Possible duplicate of [Android java.exe finished with non-zero exit value 1](http://stackoverflow.com/questions/29045129/android-java-exe-finished-with-non-zero-exit-value-1) – Tony Danilov Nov 28 '16 at 13:24

2 Answers2

0

I'm not sure, but I had same error when I didn't have enough free ram to compile project.
I tried close everything like browsers and other unneeded software and after that it worked.

uaBArt
  • 399
  • 1
  • 8
0

maybe you can check in the Android Studio's terminal this code to see more information:
On Windows: gradlew desktop:run
On Mac and Linux: ./gradlew desktop:run
In this case i use desktop as launcher, but you can replace it with: android, html, ios, ios-moe