-1

ummmOk so i'm stupid problems right now..

I'm trying to use google play services in my app.

i have referenced the library, google play serves, in both my app and BaseGameUtils, and then i references google play services as a library to the BaseGameUtiles librbary, and I get this issue.. Unable to execute dex: Multiple dex files define Lcom/google/android/gms/ads/AdActivity; "

usually what that means is that you have two .jar files that have the same class name. My only problem is I don't know which jar files have the same classes.

Also, I do not have google-play-services as a jar in my libs folder nor have i added it as an external jar in the "java build path" menu.

So all i have are two dependencies google-play-servies, and BaseGameUtils, which also uses google-play-servies as a library. but in the "private libraries" i drop down option for all the .jars i added and then it also has google-play-services included in there. which i don't think should be there..

If i uncheck the "private libraries" option, it load but then i get a "NoClassDefFoundError Android Project" error. I updated ADT to 23.0.2 or what ever the newest one is for today 7/13/14 -

so here's the jist of the problem if i check the "private libraries" option i get multiple dex files issue, i think it has something to do with android support libraries v4. but does "Multiple dex files define Lcom/google/android/gms/ads/AdActivity;" is the error i get.

if i uncheck the option "private libraries" i get NoClassDefFoundError ugh.. can someone tell me what's going on please.

ughh.

here is a picture of what i did.. after you asked me to do.. mr.. rahandandn (sorry for butchering your name)yep...

yeo again

and here's more problems it shows me..

enter image description here

here is the java build path menu option fo basegameutiles.. basegameutils

trying to use google play services for leader boards and achievements.

they say use google play services as a library for both your application and for BaseGameUtils.

they also say use google plat services as a library for BaseGameUtils.

when i do that.. i get

"Unable to execute dex: Multiple dex files define Lcom/google/android/gms/ads/AdActivity; "

that means two jar files of the same name or something like that has the same class names..

ok so that means delete the duplicate.. but guy's where is it?

this is the java build path and order export for google play services.. 1

2

here's some info on BaseGameUtils

enter image description here

4

and finally my app that im working with..

5

6

losethequit
  • 203
  • 3
  • 17
  • 2
    check your projects libs folder. DO you have the duplicate jars. they could be of different versions in which case you can copy the latest support library to your projects libs folder – Raghunandan Jul 13 '14 at 17:36
  • @raghunandan uhm.. i only have only 1 copy of each jar in my lib folder.. – losethequit Jul 13 '14 at 17:42
  • from the picture the jars are in android private libraries and also above Android 4.4w. Check them – Raghunandan Jul 13 '14 at 17:44
  • 1
    Your problem is the jars should be in your andorid private libraries only. If you reference a library project that comes under the dependencies. Pls make sure you get rid of duplciate jars. – Raghunandan Jul 13 '14 at 18:04
  • @raghunandan ok, thank you sir for you help, i think i understand the problem.. you're saying that the libs i add in the libs folder should never show up in my "java build path" which means stop adding external jars, secondly your saying that if i add a library, it will show up in the android dependencies drop down, but it doesn't need to be there because they only need to be scene in the android libraries drop down.. is that right? and if it is, how do i delete the libraries in the the android dependencies drop down menu? – losethequit Jul 13 '14 at 18:13
  • hey look at the mine sample picture. FaceBookSDK,EventBus,Bolts are library projects . The jars are under private libraries (added in the libs folder of the project). Make yours the same – Raghunandan Jul 13 '14 at 18:16
  • possible duplicate of [Unable to execute dex: Multiple dex files define Lcom/google/android/gms/ads/AdActivity;](http://stackoverflow.com/questions/24718671/unable-to-execute-dex-multiple-dex-files-define-lcom-google-android-gms-ads-ada) – JesusFreke Jul 13 '14 at 23:07

1 Answers1

0

You have Duplicate jars. Make sure you remove them. I can't point to which ones are duplicare looking at just the picture. So posted a sample of mine

A sample of my project in eclipse with jars and referencede library projects

Note : I have android-support-v4.jar in both FaceBook,EventBus and my own Project. They are of the same version.

enter image description here

enter image description here

Looking at the picture closing you also have unable to resolve target android-17...

Unable to resolve target 'android-XX'

Community
  • 1
  • 1
Raghunandan
  • 132,755
  • 26
  • 225
  • 256
  • ohh, your saying that in your facebook library, it has android support .jar somewhere and since you have it in the actual project that your publishing , you don't need it in the facebook project, so you deleted it? @raghunandan – losethequit Jul 13 '14 at 18:15
  • i would liket to mention that i had to reference google play servies as a library in the BaseGameUtiles and in the project im publishing.. i only referenced BaseGameUtiles in my project.. so google play services is referenced twice and BaseGameUtiles once.. – losethequit Jul 13 '14 at 18:18
  • Did i ever say about deleting. In my sample picture there are no duplicate jars. The libraries projects have andorid-support-v4.jar in their libs folder. All are of same version. Library projects are referenced only once. Note : **Remove duplicate jars from your projects build path** – Raghunandan Jul 13 '14 at 18:18
  • oh so mean delete android support .jar in the basegameutiles and google play servies libraries or projects imported to be used as libraries.. – losethequit Jul 13 '14 at 18:20
  • i added a picture to my question showing the java build path menu of basegameutils, thank you for you help and patience sir.. – losethequit Jul 13 '14 at 18:21
  • there is no need to delete android-support-v4.jar form your library projects. It will be there in the libs folder. They must be of same version. Delete duplicate jars. I hope i have made it clear. I can't do any more. Good luck. – Raghunandan Jul 13 '14 at 18:22
  • i hear you bro.. i just don't see this jar file that is in two spots.. this is so annoying.. @raghunandan – losethequit Jul 13 '14 at 18:33
  • i can't do anything more to help. May be someone can put it in a better way and help solve the problem. Good LUck – Raghunandan Jul 13 '14 at 18:33