1

i'm developing an android application that contain .jar file which company give it to me and it usage is for background Thread.

but when i add this jar to my project libs folder i get this error

 Error:Gradle: Execution failed for task ':hc:preDexDebug'
.>com.android.ide.common.process.ProcessException:  org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0\bin\java.exe'' finished with non-zero exit value 1**

i have searched this Error a lot i have seen these Q&A s:

Error: Gradle: execution failed for task ':app:preDexDebug'

Build error ,Gradle -> Error:Execution failed for task ':app:preDexDebug'. > org.gradle.process.internal.ExecException:

Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException

Android java.exe finished with non-zero exit value 1

why java.exe exit with value 1 in android studio

but none of them works for me .

this is my module gradle file :

buildscript {
   repositories {
    jcenter()
    }
    dependencies {
       classpath 'com.android.tools.build:gradle:1.1.1'
   }
}
apply plugin: 'com.android.application'

repositories {
    jcenter()
}

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc3"

    defaultConfig {
        applicationId "androidclient.hc"
        minSdkVersion 9
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_6
        targetCompatibility JavaVersion.VERSION_1_6
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),    'proguard-rules.pro'
        }
    }

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.android.support:support-v4:22.2.1'
}

NOTE:

1: when i remove the company .jar project works perfect with no error so i know cause is .jar of course

2: this jar does not build with gradle and it compiles with JDK8 (Which i used too)

3: i have tried deleting JDK and install it again and also i've checked for duplicate usage of .jar

4: i have used JDK8 & SDK 5.1 & intelliJ 14.1

this .jar is too important for project and i have to use it (No jar , no project) . well how can i solve this error ? should i tell company to compile their .jar with gradle or what ?

(if you think more info is needed for answer please tell me i will add it)

Community
  • 1
  • 1
K327
  • 308
  • 4
  • 10

0 Answers0