-5

I have added below dependency in my build.gradle file to implement GCM :

 compile 'com.google.android.gms:play-services:7.8.0'

But, getting below error :

Error:Execution failed for task ':app:dexDebug'.

My builg.gradle file is as below :

dependencies {
 compile fileTree(dir: 'libs', include: ['*.jar'])
 testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
//Dependency To hangle OKHTTP Operations
compile 'com.squareup.okhttp:okhttp:2.6.0'
//Dependency To Generate QRcode (Dependency to hangle QRcode libraries)
compile 'com.google.zxing:core:2.2'
compile 'com.embarkmobile:zxing-android-minimal:1.2.1@aar'
compile 'com.google.android.support:wearable:1.1.0'
//Dependency To hangle Scanning of QRCode
compile 'me.dm7.barcodescanner:zxing:1.8.3'
//Dependency To hangle Piccaso library
compile 'com.squareup.picasso:picasso:2.5.0'
//Multipart depency
// compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
compile('org.apache.httpcomponents:httpmime:4.3') {
    exclude module: "httpclient"
}
compile 'com.android.support:cardview-v7:23.0.+'
//To make imageview round cornered
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.itextpdf:itextpdf:5.5.8'
compile 'com.google.android.gms:play-services:7.8.0'
}
user5716019
  • 598
  • 4
  • 17

1 Answers1

0

Looking at the gradle file of your project I think you are facing issues with no of method constraint (which is 65536) imposed by the google.

You need to either remove unwanted library from your source code or you can create MultiDex file for your project.

To enabled multidex file do the following changes in your gradle file,

 defaultConfig {
        minSdkVersion 14
        targetSdkVersion 14
        // Enabling multidex support.
        multiDexEnabled true
    }

And create application class extending Application and put the following piece of code,

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

You can refer following link for more reference and information. http://developer.android.com/tools/building/multidex.html

Hope this will help you to resolved your issue.

Silvans Solanki
  • 1,267
  • 1
  • 14
  • 27