0

I created a simple hello world project but I am getting the following error:

Error: Execution failed for task '`:app:transformClassesWithDexForDebug`'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1.

I have added multiDexEnabled true in build.gradle but it is still showing the above error.

My build.gradle file:-

android {
    compileSdkVersion 23
    buildToolsVersion "25.0.2"

    defaultConfig {
        applicationId "com.example.bliss76.myapplication"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true


    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
}
Mark Wragg
  • 22,105
  • 7
  • 39
  • 68

2 Answers2

0

Have you remembered to change the manifest?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.myapp">
<application
        android:name="android.support.multidex.MultiDexApplication" >
    ...
</application>

Read more about it here.

Uriel Frankel
  • 14,304
  • 8
  • 47
  • 69
0

Try with attach in dependencies

compile 'com.android.support:support-v4:23.4.0'
Nitin Patel
  • 1,605
  • 13
  • 31