2

I am new in android programming and I use android studio IDE. I am trying to run a program but I face with this error: `Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_45\bin\java.exe'' finished with non-zero exit value 2`

I have searched a lot on the internet. There was a solution which said: Try to remove your jar files one by one and then in each time build your project. So you can the jar file which caused the problem. But this couldn't help me.

In another solution, I found that this i=may be because of duplication of names. I have checked all files and I didn't found any duplication.

I found another solution but I couldn't understand it.

So, I'm getting confused what I should do. It is really annoying.

Can anyone please help me to understand the problem.? Thanks in advance

  • Sorry for my poor english
  • By the way, this is build.gradle

    apply plugin: 'com.android.application'
    android {
       compileSdkVersion 22
       buildToolsVersion "22.0.1"
    
       defaultConfig {
           applicationId "b.ir"
           minSdkVersion 14
           targetSdkVersion 22
           versionCode 1
          versionName "1.0"
        }
        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.1.1'
             compile files('libs/glide-3.3.1.jar')
             compile files('libs/okhttp-2.4.0.jar')
             compile files('libs/analytics-1.2.0.jar')
             compile files('libs/google-play-services.jar')
             compile 'com.google.android.gms:play-services:4.1.32'
             compile files('libs/mimecraft-1.1.1.jar')
             compile files('libs/library-1.2.2.jar')
             compile files('libs/com.google.android.maps.jar')
             compile 'com.google.android.exoplayer:exoplayer:r1.2.3'
             compile files('libs/realm-0.82.0.jar')
        }
    
Community
  • 1
  • 1
TTS
  • 67
  • 3
  • 11

2 Answers2

0

Have you tried? :

"I suddenly had the same problem, after no noteworthy changes.

I solved it by deleting the app/build directory and let gradle build the whole project new."

or:

"Could fix this by adding compile 'com.android.support:support-v4:18.0.0' to the dependencies in the vertretungsplan build.gradle, compile and then remove this line and compile again.

now it works"

This solutions are from this post, hope it helps.

Android Studio: Gradle - build fails -- Execution failed for task ':dexDebug'

Community
  • 1
  • 1
0

There was a problem. The problem arises in connection with the conflict gradle and connected dependencies. In my case I changed in app/build.gradle version "compile 'com.googlecode.json-simple:json-simple:1.1.1'" for older 1.1 (compile 'com.googlecode.json-simple:json-simple:1.1'). Check connected dependence and computational conflicts with gradle.

When you can change the version or select another tool. Good luck!

Andrei Anhurets
  • 143
  • 1
  • 13