开发者

jar dependencies in android- no class definition found exception

I resolved this issue myself. It turns out that the activation framework requires some libraries that aren't native to android, myjava.awt.datatransfer, org.apache.harmony.awt.*, and org.apache.harmony.misc. Once i added those libraries everything worked fine.

I'm trying to use the gdata java client library on android and have managed a decent hack to get it working. However because the jar for gdata had some package discrepancies with android I had to import the source into my project. This source is dependent on the JavaMail API and the JavaBeans Activation Framework as specified here.

My issue is that the JavaMail jar throws a class definition not found when seeking a class which is in the Activation Framework jar. A stack trace is listed below. I am working in Eclipse and have both jars in a lib folder and added to my build path. I'm not very experienced dealing with jars in a situation like this so any help or insight would be appreciated.

03-29 09:55:26.204: ERROR/AndroidRuntime(331): Uncaught handler: thread AsyncTask #3 exiting due to uncaught exception
03-29 09:55:26.215: ERROR/AndroidRuntime(331): java.lang.RuntimeException: An error occured while executing doInBackground()
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at android.os.AsyncTask$3.done(AsyncTask.java:200)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.FutureTask.run(FutureTask.java:137)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.lang.Thread.run(Thread.java:1096)
03-29 09:55:26.215: ERROR/AndroidRuntime(331): Caused by: java.lang.NoClassDefFoundError: javax.activation.开发者_如何学GoDataHandler
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at javax.mail.internet.MimeBodyPart.setContent(MimeBodyPart.java:684)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at com.google.gdata.data.media.MediaBodyPart.<init>(MediaBodyPart.java:95)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at com.google.gdata.data.media.MediaMultipart.<init>(MediaMultipart.java:126)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at com.google.gdata.client.media.MediaService.insert(MediaService.java:382)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
03-29 09:55:26.215: ERROR/AndroidRuntime(331):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)


Looks like it doesn't support android. Maybe in a future SDK. Link Since it runs with the Davlik Runtime and not the standard JRE there are probably missing classes that aren't in the Davlik JRE.


I resolved this issue myself. It turns out that the activation framework requires some libraries that aren't native to android, myjava.awt.datatransfer, org.apache.harmony.awt.*, and org.apache.harmony.misc. Once i added those libraries everything worked fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜