Error creating apk - "Multiple dex files define Lcom / google / ads / Ad"

I took my hair off of it, for the last 3 hours I tried to fix it, but could not. I have created an Android application and I am ready to put it on the Android market, but I get this error when trying to export to apk.

Unable to run dex: multiple dex files define Lcom / google / ads / Ad;

I read a bunch of problems and tried a lot of solutions, but nothing helped. I cleaned and rebuilt, I delete the bin folder, I made sure that the bin folder excludes the build path. Nothing succeeded. If anyone could help me, I would really appreciate it.

+6
java android eclipse dex
source share
6 answers

In another post with a problem like yours, the only thing you haven't talked about before is the Eclipse update. I donโ€™t know how and what order you made these โ€œcorrectionsโ€, but another poster said that he immediately deleted the bin directory for his project, cleaned and rebuilt the project, and restarted Eclipse. After that, the error disappeared.

Luck-Liyap

+5
source share

Unlock the admob jar file in the "order and export" section of the "configure build path" section.

+9
source share

For me, the error occurred due to the accidental inclusion of two different versions of the AdMob SDK. Deletion of one of them is fixed.

+1
source share

As already noted, this problem should be caused by the fact that several classes of Goodle ad SDK classes are included in the application. What I have not seen yet is a note that the most recent Google Play Service library includes classes that (at least) use the same names as some of admob sdk, for example, I encountered this error, because I tried to build using admob sdk v.4.0.4 and the google-play-services_lib project as a reference project; the latter contains google-play-services.jar, which contains the com.google.ads package and many of the same classes as admob sdk. Thus, it seems that the google play and admob sdk game services cannot be used in this application. My solution was to completely remove admob sdk from the assembly.

+1
source share

I had the same or similar problem. My problem was that my application imported a library that used a different version of the AdMob SDK.

Details of my problem:

  • Library using AdMob SDK 6.3.0
  • Used AdMob SDK 6.1.0 application

Fixed its inclusion of the same version.

0
source share

For me, I just need to take out the libs folder that contains android-support-v4.jar from the build path, and it worked.

0
source share

All Articles