0

I'm using Android Studio for the first time and I got the following error

Error:Execution failed for task ':app:dexDebug'.
    > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with non-zero exit value 2

build.gradle:

 dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile project(':tag-cloud')
        compile('com.twitter.sdk.android:twitter:1.8.0@aar') {
            transitive = true;
        }
        compile files('libs/bolts-android-1.2.1.jar')
        compile files('libs/aws-android-sdk-s3-2.2.6.jar')
        compile files('libs/aws-android-sdk-core-2.2.6.jar')
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
            transitive = true;
        }
        compile 'com.android.support:appcompat-v7:23.0.1'
        compile 'com.github.ksoichiro:android-observablescrollview:1.6.0'
        compile 'com.facebook.android:facebook-android-sdk:4.6.0'
        compile 'de.hdodenhof:circleimageview:1.3.0'
        compile 'com.koushikdutta.ion:ion:2.1.6'
        compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
        compile 'com.google.android.gms:play-services:8.4.0'
        compile 'com.android.support:recyclerview-v7:23.0.1'
        compile 'com.nineoldandroids:library:2.4.0'
        compile 'com.android.support:design:23.0.1'
        compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
        compile 'de.greenrobot:eventbus:2.4.0'
        compile files('libs/FlurryAnalytics-6.2.0.jar')
        compile 'me.leolin:ShortcutBadger:1.1.3@aar'
    }

Do you have any idea what the problem could be and how can it be solved? A good explanation for the problem would be useful too as I am new to Android Studio. Thanks in advance :)

Raj
  • 950
  • 1
  • 9
  • 33
  • See this. http://stackoverflow.com/questions/29460443/execution-failed-for-task-appdexdebug-com-android-ide-common-process-proces . It may help. – ajantha Dec 29 '15 at 08:51
  • Clean the project and build again, chances are that some stale files have been left over – Shark Dec 29 '15 at 08:51
  • 1
    Possible duplicate of [Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException](http://stackoverflow.com/questions/28917696/errorexecution-failed-for-task-appdexdebug-com-android-ide-common-process) – Usman Kurd Dec 29 '15 at 08:56
  • Check my answer http://stackoverflow.com/questions/33313101/dexindexoverflowexception-only-when-running-tests?answertab=active#tab-top – IntelliJ Amiya Dec 29 '15 at 09:02
  • http://stackoverflow.com/questions/34416383/execution-failed-for-task-appdexdebug/34417189#34417189 Refer this solution – JItesh SUvarna Dec 29 '15 at 09:30

1 Answers1

1

This options may solve the issue

  • Clean The Project
  • Remove all unused dependencies in build.gradle
  • If not solved then Declare this in gradle config.

    defaultConfig {

    multiDexEnabled true
    

    }

Shree Krishna
  • 8,474
  • 6
  • 40
  • 68
  • Cleaned the project and added multiDexEnabled true. but issue not solved. get same error – Raj Dec 29 '15 at 09:43
  • It is sure that this problem is raised because of your dependencies. make sure you have files in your libs that are specified in compile files command. And check each line of compilation in your dependencies. – Shree Krishna Dec 29 '15 at 09:49
  • Next option is Try updating some of them if it won't affect codes like de.hdodenhof:circleimageview is now 2.0.0. – Shree Krishna Dec 29 '15 at 09:56