简体   繁体   English

ADT / Eclipse升级后库的问题

[英]Trouble with Library after ADT/Eclipse upgrade

I recently upgraded my eclipse installation to Juno and installed the latest android ADT, and now when I try to compile one of my older applications I get a problem. 我最近将我的eclipse安装升级到Juno并安装了最新的Android ADT,现在当我尝试编译我的一个旧应用程序时,我遇到了问题。

I haven't changed any code since it used to work, there are no errors in compiling the app, and I'm able to export a new APK without error. 我没有更改任何代码,因为它曾经工作,编译应用程序没有错误,我能够导出新的APK没有错误。

However when I try to run it, I get a ton of warnings and errors about dead code, unable to find class, unable to resolve method in my Jsoup library, like the following: 但是,当我尝试运行它时,我收到大量关于死代码的警告和错误,无法找到类,无法解析我的Jsoup库中的方法,如下所示:

09-08 20:23:26.006: I/dalvikvm(24213): Could not find method org.jsoup.Jsoup.parse, referenced from method com.myapp
09-08 20:23:26.006: W/dalvikvm(24213): VFY: unable to resolve static method 557: Lorg/jsoup/Jsoup;.parse (Ljava/lang/String;)Lorg/jsoup/nodes/Document;
09-08 20:23:26.006: D/dalvikvm(24213): VFY: replacing opcode 0x71 at 0x0047
09-08 20:23:26.006: D/dalvikvm(24213): VFY: dead code 0x004a-0059 in Lcom/karwosts/PortfolioMap/GoogleFinance;.SendHttpRequest (Ljava/lang/String;Ljava/lang/String;)Lorg/jsoup/nodes/Document;
09-08 20:23:26.006: W/dalvikvm(24213): VFY: unable to find class referenced in signature (Lorg/jsoup/nodes/Document;)
09-08 20:23:26.006: W/dalvikvm(24213): VFY: unable to find class referenced in signature (Lorg/jsoup/nodes/Document;)

and as soon as my app calls a Jsoup method it dies with 一旦我的应用程序调用Jsoup方法,它就会死掉

09-08 20:23:28.566: E/AndroidRuntime(24213): FATAL EXCEPTION: IntentService[com.myapp]
09-08 20:23:28.566: E/AndroidRuntime(24213): java.lang.NoClassDefFoundError: org.jsoup.Jsoup

Another problem is that the new APK I export is 77kb, where my old APK used to be 199kb, so it seems like there's a big chunk of something missing. 另一个问题是我导出的新APK是77kb,我的旧APK曾经是199kb,所以看起来有很多东西丢失了。

I cleaned the project, I tried deleting the project from workspace and creating new project from existing code, and it didn't help. 我清理了项目,我尝试从工作区删除项目并从现有代码创建新项目,但它没有帮助。 I've tried changing Java compiler version to 1.5 or 1.6 or 1.7 and it didn't help. 我已经尝试将Java编译器版本更改为1.5或1.6或1.7,但它没有帮助。

This is my build path library settings: 这是我的构建路径库设置:

在此输入图像描述

Order and export: 订单和出口:

在此输入图像描述

Any ideas what might have broken would be appreciated. 任何可能破坏的想法都将受到赞赏。 I'm using Android SDK 20.0.3 我正在使用Android SDK 20.0.3

The JSoup library has to be included in the project (hence the diminished filesize). JSoup库必须包含在项目中(因此文件大小减少)。 By going to the Build Path settings, Order and Export tab, you can tick the checkbox next to the JSoup library to ensure that it is included in the project when you export it. 通过转到“构建路径”设置,“ Order and Export选项卡,您可以勾选JSoup库旁边的复选框,以确保在导出项目时它包含在项目中。 Make sure to clean and rebuild after doing this. 执行此操作后,请务必清理并重建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM