-1

Ok guys, I would first like to thank everyone in the past. Putting up with my poor punctuation, duplicate posts and questions I could've answered on my own.

This one is a toughy,

Okay, so for the last 2 days I had this issue..

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

which means two jar files where in the same build path shared the same classnames..

I was trying to use BaseGameUtils and google-play-services as libraries to use Leaderboards and Achievements.

Okay, so I figured out the problem.. I'm saying all this background info, because it may better explain the problem.. this was the solution..

Let's say I had 3 jar files in my libs..

1 - Flurry analytics
2 - Revmob ads
3 - Heyzap social network for games

Those 3 jars were also in my "Android Private Libraries"

The library, google-play-services was added into the "Android Private Libraries" along with the 3 other JARs. The reference library google-play-services was added to BaseGameUtils as instructed so that created to copies of the same library in the same build.. so I had to add the 3 jars externally to the build path and ignore the 3 in the "Android Private Libraries".

Now the question I actually have is,

I'm getting an error on this line 28 that says ..

    super.onCreate(savedInstanceState);

Someone once asked me to post the Logcat, but I'm telling you it says the error says the line

    super.onCreate(savedInstanceState);

is causing an error..

Now check this out.. I've tried this on two classes

public class GPSLauncher extends BaseGameActivity implements
        View.OnClickListener {

public class OtherAct extends BaseGameActivity {

if i extend the regular Activity i get no errors, you know like usual..

but when I try

extends BaseGameActivity {

I get the error

Android runtime: at com.sdsd.sdsd onCreate(OtherAct.java:28)

    super.onCreate(savedInstanceState);

So let's bring this all around. when I deselect the private libraries, I'm omitting the google-play-services library in that folder.. could that be the problem?

Valery Viktorovsky
  • 6,487
  • 3
  • 39
  • 47
losethequit
  • 203
  • 3
  • 17
  • 1
    can someone help me please, sorry about the punctuation. never knew it was so important. – losethequit Jul 14 '14 at 15:10
  • I'm pretty sure you are not importing the BaseGameActivity, and it's also a good question whether it's actually available on the classpath. Probably something with the project build path. – EpicPandaForce Jul 15 '14 at 10:21
  • @Zhuinden yes sir, i think i understand... i just wish someone with team viewer could help me, just look at my mac and just fix it, I deselect "android private libraries" which makes, the google play library not export in the build path. like the 3 jars i have in my libs folder, needed to be added externally, because inside the private libraries.. shows the 3 jars i have in the libs folder plus a reference to the google library.. and because the BaseGameUtils references google play services as a library, i think thats why i see the the multiple dex file errors.. thank you fo your help sir./. – losethequit Jul 15 '14 at 14:33

1 Answers1

0

According to that error message that you have posted, you have two different jars in your project that define the same class.

IF you are using admobs (I do not know if you are) then most likely it is because admobs has now been moved into google play services. You should look at

Multiple dex files define - Deleting extra jar file still not working. What should I do?

Community
  • 1
  • 1
IanB
  • 3,489
  • 1
  • 20
  • 24