下载谷歌ADT 集成的MAC开发工具后,发现导入一个在windows电脑可以运行的程序,在mac上面就不能运行了,程序编译没有问题,一运行就挂了,异常如下:
01-09 04:19:15.303: W/dalvikvm(8626): Unable to resolve superclass of Lcom/xxx/xxx/test; (54)
01-09 04:19:15.303: W/dalvikvm(8626): Link of class 'Lcom/xxx/xxx/BaseActivity;' failed
01-09 04:19:15.303: W/dalvikvm(8626): Unable to resolve superclass of Lcom/xxx/xxx/test; (98)
01-09 04:19:15.313: W/dalvikvm(8626): Link of class 'Lcom/xxx/xxx/test;' failed
01-09 04:19:15.313: D/AndroidRuntime(8626): Shutting down VM
01-09 04:19:15.313: W/dalvikvm(8626): threadid=1: thread exiting with uncaught exception (group=0x4001d5a0)
01-09 04:26:38.245: E/AndroidRuntime(8866): Caused by: java.lang.ClassNotFoundException: com.xxx.xxx.test in loader dalvik.system.PathClassLoader[/data/app/com.xxx.xxx-1.apk
这是异常的主要log,解决方法是:选择项目右键 > Build path > Order and Export 然后勾选加入的第三方包 点击OK。需要提醒一点的是,这些jar都必须放到libs文件夹里面。
郁闷了两小时,分享一下。