using GoogleAdMobAdsSDK-4.0.2.jar with GSON 1.5 in an Android project

82 views
Skip to first unread message

binnyb

unread,
Mar 25, 2011, 11:31:14 AM3/25/11
to Google AdMob Ads Developers
I recently downloaded the newest GoogleAdMobAdsSDK-4.0.2.jar to use in
my Android project. My project also uses the gson-1.5.jar library.

After importing the GoogleAdMobAdsSDK-4.0.2.jar and build, the Console
reports this error:

[2011-03-25 11:28:37 - <appname>] Error generating final archive:
Found duplicate file for APK: assembly-descriptor.xml
Origin 1: C:\Users\<myusername>\Documents
\admob4\GoogleAdMobAdsSDK-4.0.2.jar
Origin 2: C:\Users\<myusername>\Documents\gson\gson-1.5.jar

When i remove the gson-1.5.jar from the project, this error goes
away. I would like to use GSON in my project. What is the problem
here? How can i use both GSON and GoogleAdMobAdsSDK-4.0.2.jar?

Rory Lydon

unread,
Mar 25, 2011, 3:17:12 PM3/25/11
to google-adm...@googlegroups.com
Hey binnyb.

> When i remove the gson-1.5.jar from the project, this error goes away. I would like to use GSON in my project. What is the problem here? How can i use both GSON and GoogleAdMobAdsSDK-4.0.2.jar?

There's a copy of GSON embedded in the Google AdMob Ads SDK JAR. You should be able to simply use that by removing your own copy of GSON from your project, and it sounds like that works. Please let us know if it doesn't...

Thanks!

binnyb

unread,
Mar 25, 2011, 3:34:03 PM3/25/11
to Google AdMob Ads Developers
When i remove my copy of GSON, i cannot successfully build(it can't
find GSON).

There doesn't seem to be an import for Gson using
GoogleAdMobAdsSDK-4.0.2.jar, or at least i can't find out how to
import it. Eclipse's "auto import" or "quick fix" can't find the
correct import, and i can't find it inside com.google.ads or anywhere
else for that matter.

Rory Lydon

unread,
Mar 25, 2011, 4:14:02 PM3/25/11
to google-adm...@googlegroups.com
Please try 4.0.3 or 4.0.4.

Thanks!

binnyb

unread,
Mar 25, 2011, 4:52:50 PM3/25/11
to Google AdMob Ads Developers
I switched to 4.0.4 and it is working great now.

Thanks!
Reply all
Reply to author
Forward
0 new messages