简体   繁体   中英

I m getting this error ..pls guide me to solve it

**Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\\Program Files\\Java\\jdk1.7.0_79\\bin\\java.exe'' finished with non-zero exit value 3**

**My Girdle file **

apply plugin: 'com.android.application'

 android {
  compileSdkVersion 23
  buildToolsVersion "23.0.2"

 defaultConfig {
    applicationId "com.app"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 16
    versionName "1.16"
    multiDexEnabled true
 }
 buildTypes {
    release {
        minifyEnabled false
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
 }

 compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
 }

 packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
  }
 }

 dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  testCompile 'junit:junit:4.12'
  compile 'com.facebook.android:facebook-android-sdk:4.+'
  compile 'com.google.android.gms:play-services:8.4.0'
  compile 'com.google.android.gms:play-services-appinvite:8.4.0'
  compile 'com.google.android.gms:play-services-analytics:8.4.0'
  compile 'org.apache.httpcomponents:httpclient:4.5.1'
  compile 'com.android.support:multidex:1.0.0'
  compile 'com.android.support:support-v13:23.1.1'
  compile 'com.android.support:design:23.1.1'
  compile 'com.google.android.gms:play-services-ads:8.4.0'
  compile 'com.google.android.gms:play-services-identity:8.4.0'
  compile 'com.google.android.gms:play-services-gcm:8.4.0'
  compile 'com.android.support:support-v4:23.1.1'
  compile 'com.jayway.android.robotium:robotium-solo:5.5.4'
 }

1) First of all, try cleaning and restarting your Project. In most of the cases this will resolve the issues.

2) If problem still persists:

Import multidex dependency:

dependencies {
  compile 'com.android.support:multidex:1.0.1'
}

In your manifest add the MultiDexApplication class:

    <application
        ...
        android:name="android.support.multidex.MultiDexApplication">
        ...
    </application>

If your app already extends the Application class, you can override the attachBaseContext() method and call MultiDex.install(this) to enable multidex .

protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
}

Finally, update your build.gradle by adding multiDexEnabled true :

defaultConfig {  
        ...
        multiDexEnabled true  
    }  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM