Conflicting Versions of GSON?

52 views
Skip to first unread message

billmag

unread,
Apr 2, 2012, 8:09:13 PM4/2/12
to google-gson
Greetings-

I'm currently working on an Android library meant to be incorporated
into external apps to provide an easy way to consume some popular
RESTful APIs.

As part of that effort, I've been looking around at JSON processors
and it seems like GSON is my best option, especially if I'm targeting
Android 2.2+.

My one concern is causing library version conflicts for people who
want to use my library. If I build against a particular version of
GSON is it possible to package it up in my own .jar? Are there other
viable options for dealing with this?

Alternatively, have you used other libraries which have specific
external library dependencies and had to deal with multiple version
conflicts? I'd like to simultaneously make integration of my own
library simple for other developers and keep the size of my library to
a minimum.

-Bill

Inderjeet Singh

unread,
Apr 2, 2012, 8:24:50 PM4/2/12
to google-gson
I think a good approach would be to bundle your own version of Gson
with renamed packages.
Other approaches have the risk of conflicting with the version of Gson
that the app-developer may want to use.

Another viable option is to bundle gson.jar but allow developer to
replace it with a newer version. Gson is backwards compatible, so such
an approach is going to work.

HTH
Inderjeet Singh
http://www.trymph.com/
Reply all
Reply to author
Forward
0 new messages