2

I am using google play services in my project only for GCM. I got the following error when I updated my google play services library

[2015-12-04 14:50:10 - MyGame] Dx 
trouble writing output: already prepared
[2015-12-04 14:50:14 - Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536
[2015-12-04 14:50:14 - MyGame] Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536

On googling I found that this error was thrown because my dex file exceeded the limit.I do not want to split my dex file. Can anyone tell me how to remove unused functions. I do not see much suggestion for doing this using eclipse.

I have seen people suggesting to use proguard, but somehow this is not working for me. It might be because I am not all that familier with using proguard.

Please help.

glo
  • 1,408
  • 3
  • 25
  • 54

1 Answers1

0

Try adding just this for gcm

com.google.android.gms:play-services-gcm:8.3.0

Note: If the number of method references in your app exceeds the 65K limit, your app may fail to compile. You may be able to mitigate this problem when compiling your app by specifying only the specific Google Play services APIs your app uses, instead of all of them. For information on how to do this, see Selectively compiling APIs into your executable.

random
  • 10,238
  • 8
  • 57
  • 101
  • How are you using google play services in your app? I guess by including com.google.android.gms:play-services:8.3.0 as a dependency in build.gradle. – random Dec 04 '15 at 09:44
  • I am using eclipse not android studio – glo Dec 04 '15 at 09:45
  • 1
    ok let's try this out solutions here: http://stackoverflow.com/questions/26891208/shrink-google-play-services-library-for-use-with-google-analytics-only If it doesn't work will look for other alternatives – random Dec 04 '15 at 09:54