0

I was using

compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-appinvite:8.4.0'

in my application build.gradle and this in my project build.gradle

classpath 'com.google.gms:google-services:2.0.0-beta2'

From last 10 days i was getting crash because of GCM at the time of InstanceId. So i found that we need to update GCM to latest gradle so i did the same

classpath 'com.google.gms:google-services:3.0.0'

and

compile 'com.google.android.gms:play-services-gcm:9.0.2'
compile 'com.google.android.gms:play-services-appinvite:9.0.2'

but now am getting Multidex error due to this. So i tried to resolve that too by following few steps like extending Application class with MultiDexApplication and all. Still getting the same issue.

My gradle dependencies

 compile project(':aws-android-sdk-core-2.2.9')
compile project(':aws-android-sdk-s3-2.2.9')
compile project(':universal-image-loader-1.9.5')
compile project(':FlurryAnalytics-6.2.0')
compile project(':circularImageView')
compile project(':swipeMenuListView')
compile 'com.couchbase.lite:couchbase-lite-android:1.2.0'
compile 'com.instabug.library:instabugsupport:1.+'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-appinvite:8.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:multidex:1.0.1'

Any help will be appreciated!

Rohit
  • 810
  • 2
  • 9
  • 34

2 Answers2

0

In your build.gradle you may use this

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

So, remove it and use the needed API only,

Check the VicVu Answer in this link, gradle - Android Studio build too slow multidex application

Community
  • 1
  • 1
Panneer Selvam R
  • 443
  • 3
  • 11
0

Have you tried adding the heap size adjustment to your build.gradle file? For example this will set the max heap size for dexing to 4GB, and it will also enable multiDexEnabled option.

android {
    ...
    dexOptions {
        javaMaxHeapSize "4g"
    }

defaultConfig {
        multiDexEnabled true
     }
}
U.Swap
  • 1,921
  • 4
  • 23
  • 41