Issues with Android ADT, Proguard and External Jars?

So, if you happen to find this answer, and are like, hm, I have that problem too, I wish he posted his solution, you're half in luck.

Up vote 0 down vote favorite 1 share g+ share fb share tw.

So, I'm trying to get the ADT's built-in proguard implementation working for my app. Unfortunately, it seems to be choking on various classes in third-party libraries I references. I've tried various, if not all, the combinations of -libraryjars and -keep public class lines I can think of, but it's all to no good.

I'm not that experienced with Proguard, so honestly, I don't know where I'm going wrong. I've tried google, but most of the information relates to Ant scripts. Some of the things I've tried: Lines like -libraryjars C:\Users\Dave\workspace\Dropbox_Sync_for_Tasker_and_Locale\lib\apache-mime4j-0.6.

Jar at the top or bottom of the file Lines attempting to make paths to jars like that relatively, to no success at all. Lines like -keep public class org.apache.commons.logging. LogFactory Line that refer to the other part of the error lines, like -keep public class org.apache.james.

Mime4j.field. MailboxListField Anyway, the error log is a huge wall of text, so I've put it on a pastebin here. Android eclipse adt proguard link|improve this question asked Jan 24 '11 at 19:50camperdave3071211 100% accept rate.

It looks like you might be running into one of those platform assumptions Android makes. You probably want to put your library jars into libs/ inside your Android projects root. It seems like android works on the assumption that external jar libraries will be located in this directory.

– Nick Campion Jan 24 '11 at 20:05 The libraries are in that folder. I tried referencing them via a relative path, and kept getting IOExceptions from Proguard. Edit: I just noticed I'm using the lib folder, not libs.

When I go back to my computer, I'll see if that's the issue... – camperdave Jan 24 '11 at 20:13 So, yeah, doing that used to work. Then, I made a minor change and re-built, and it stopped working. I have no idea what to do now.

– camperdave Jan 31 '11 at 7:08 putting them in "libs" and using a relative path works well (for me) – Someone Somewhere May 30 '11 at 1:21.

So, if you happen to find this answer, and are like, hm, I have that problem too, I wish he posted his solution, you're half in luck. The way I fixed it was to just stick the -libraryjars lines in there, and then -dontwarn org.apache.commons.logging. LogFactory -dontwarn net.jcip.annotations.

NotThreadSafe -dontwarn net.jcip.annotations. ThreadSafe -dontwarn net.jcip.annotations. Immutable And it worked fine.

It's a hack, and it's dirty, but it solved it for me. Unfortunately, you're still on your own if you too have this problem.

I had exactly the same problem after adding "apache-mime4j-0. 6.1. Jar" and "httpmime-4.0.1. Jar" to my project.

(for multipart POST'ing of binary data to my server). I am also not familiar with pro-guard but at least I've managed to add my custom widget to the proguard. Cfg - unfortunately the apache library proved even more difficult to add!

This is my fix... I have this added to the bottom of proguard. Cfg : #APACHE LIBRARY -libraryjars /libs/apache-mime4j-0. 6.1. Jar -libraryjars /libs/httpmime-4.0.1.

Jar -keepnames class org.apache. ** {*;} -keep public class org.apache. ** {*;} -dontwarn org.apache.commons.logging.

LogFactory -dontwarn org.apache.http.annotation. ThreadSafe -dontwarn org.apache.http.annotation. Immutable -dontwarn org.apache.http.annotation.

NotThreadSafe I was hoping that the first 4 lines would be the fix. Unfortunately the dontwarn's are needed to really "fix" it. Correct me if I am wrong (since I'm no proGuard pro), but I believe the first 4 lines make sure that the libraries are used as-is.

The second section of four lines (dontwarn) just cover up the remaining crap and don't correct some underlying issue. What the underlying issue is I don't know.

Try downloading the commons-logging. Jar, put it in your libs and add a -libraryjars to your proguard config.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions