java - Proguard issues with jar files, how to find the missing jar? -
when try export apk proguard lot of errors (over 400) similar to:
warning: org.codehaus.jackson.jaxrs.jsonmappingexceptionmapper: can't find superclass or interface javax.ws.rs.ext.exceptionmapper
and
org.codehaus.jackson.xc.datahandlerjsondeserializer$1: can't find superclass or interface javax.activation.datasource
i using jackson json library, , errors seem related that.
researching error found following proguards faq:
if there unresolved references classes or interfaces, forgot specify essential library. proper processing, libraries referenced code must specified, including java run-time library. specifying libraries, use -libraryjars option.
searching around on found lot of unanswered questions related this, general sense jar file using (in case jackon json) relying on more libraries , need added proguard's config file how.
however, can't figure out how determine jars needed , are. warnings mention lot of different packages such javax.ws.rs.ext, org.joda.time, org.codehaus.stax2, javax.xml.stream, etc.
- how determine jars contain packages? example, jar required javax.ws.rs.ext.** classes?
- how figure out jars , path used -libraryjars in proguard?
thanks much
edit: should mention using android library project setup. jars in main library project, , actual working project has build paths including jars in library project. don't know if makes difference thought should mention it.
update test, removed jackson far build path , code , proguard completes successfully. questions still remain... correct approach handling these errors?
does android export wizard in eclipse automatically add /lib/ jars proguard or have added manually in proguard config file this:
-libraryjars c:/project/lib/somjar.jar
i did try jackson 1 didn't make difference. mean have find of jars needed classes mentioned in warnings , add those? in sdk or in java installation?
sorry if these stupid questions, have been trying figure out last couple hours , have no idea do.
thanks again
update again
so more searching, combined benjamin's suggestion, found of missing classes in rt.jar, in jdk's lib folder. ended adding
-libraryjars <java.home>/lib/rt.jar
to proguard.cfg file , brought warnings 485 down 204. hey guess that's something... remaining warnings describe classes cannot find @ all. app works fine without running proguard, these classes must somewhere right? or these warnings should use -dontwarn
with?
the remaining classes in these packages:
org.joda.time. org.codehaus.stax2. javax.ws.rs.
so need way figure out:
- what jars have these classes
- where these jars can include them in proguard config file
i've had similar problems proguard , similar errors using osmdroid.jar built ok unobfuscated. jar must have had external dependencies application didn't need. fortunately authors listed jars needed , once downloaded them , told proguard via -libraryjars option, proguard build ok.
re missing jars (which don't need, proguard thinks might!), should find them at:
org.joda.time (the jar's inside zip)
Comments
Post a Comment