3
votes

I'm working on a map library and I'm using Google-Play-Services. So Far so good. Problem is this:

  1. I include Google-Play-Services library project in my map library (using: properties -> android -> add library). Tested it using a client within the library (Unchcecking the library checkbox and launching a mainActivity) and works fine!
  2. When I include my map library in a sample client project, this client project won't have access to Google Play Services, why? If I include Google play services in the client project, I get:

    [2013-07-18 08:40:04 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/android/gms/R$attr;

    [2013-07-18 08:40:04 - maps-sample-android] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/android/gms/R$attr;

Android won´t let include Google Play Services on my own or use it from my library project, is there any way to solve this?

2
how have you referred to google plat services library project? - Raghunandan
did you got any solution? I also had same problem now.. - Shalini
I have the same problem in Android Studio :( - Raphael Royer-Rivard
Ever resolve this? I have the exact same issue........ - Zippy

2 Answers

2
votes

[2013-07-18 08:40:04 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/android/gms/R$attr;

[2013-07-18 08:40:04 - maps-sample-android] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/android/gms/R$attr;

These errors suggest that you have 2 different jar files which are both trying to declare the same variable. Perhaps you have 2 different versions of the google-play-services?

0
votes

In your library project properties in the java build path (order and export tab) make sure that the Android dependancies box is ticked.

This will allow the library project to export the google play library with it.

You will then not need to add a reference to google play in the client project.