android异常,即使jdom库存在

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了android异常,即使jdom库存在相关的知识,希望对你有一定的参考价值。

jdom库在那里,我已经删除并一次又一次地添加到构建路径。而且,我已多次清理该项目。但我仍然得到这个错误:

 04-27 10:51:27.867: W/ActivityThread(530): Application com.pkg.src.nhs.glos is waiting for the debugger on port 8100...
    04-27 10:51:27.936: I/System.out(530): Sending WAIT chunk
    04-27 10:51:29.396: I/dalvikvm(530): Debugger is active
    04-27 10:51:29.736: I/System.out(530): Debugger has connected
    04-27 10:51:29.746: I/System.out(530): waiting for debugger to settle...
    04-27 10:51:29.996: I/System.out(530): waiting for debugger to settle...
    04-27 10:51:30.262: I/System.out(530): waiting for debugger to settle...
    04-27 10:51:30.479: I/System.out(530): waiting for debugger to settle...
    04-27 10:51:30.689: I/System.out(530): waiting for debugger to settle...
    04-27 10:51:30.896: I/System.out(530): waiting for debugger to settle...
    04-27 10:51:43.786: D/dalvikvm(553): GC freed 683 objects / 60040 bytes in 110ms
    04-27 10:51:49.396: W/dalvikvm(553): VFY: unable to find class referenced in signature (Lcom/androidquery/AQuery;)
    04-27 10:51:49.576: W/dalvikvm(553): VFY: unable to find class referenced in signature (Lcom/androidquery/util/XmlDom;)
    04-27 10:51:49.646: W/dalvikvm(553): VFY: unable to find class referenced in signature (Lcom/androidquery/callback/AjaxStatus;)
    04-27 10:51:49.646: I/dalvikvm(553): Could not find method com.androidquery.util.XmlDom.tags, referenced from method com.pkg.src.nhs.glos.MainActivity.setImageCallBack
    04-27 10:51:49.646: W/dalvikvm(553): VFY: unable to resolve virtual method 80: Lcom/androidquery/util/XmlDom;.tags (Ljava/lang/String;)Ljava/util/List;
    04-27 10:51:49.646: D/dalvikvm(553): VFY: replacing opcode 0x6e at 0x0013
    04-27 10:51:49.646: D/dalvikvm(553): Making a copy of Lcom/pkg/src/nhs/glos/MainActivity;.setImageCallBack code (200 bytes)
    04-27 10:51:50.126: E/dalvikvm(553): Could not find class 'org.jdom.input.SAXBuilder', referenced from method com.pkg.src.nhs.glos.MainActivity$SetImageTask.doInBackground
    04-27 10:51:50.126: W/dalvikvm(553): VFY: unable to resolve new-instance 166 (Lorg/jdom/input/SAXBuilder;) in Lcom/pkg/src/nhs/glos/MainActivity$SetImageTask;
    04-27 10:51:50.126: D/dalvikvm(553): VFY: replacing opcode 0x22 at 0x0009
    04-27 10:51:50.126: D/dalvikvm(553): Making a copy of Lcom/pkg/src/nhs/glos/MainActivity$SetImageTask;.doInBackground code (205 bytes)
    04-27 10:51:50.736: W/dalvikvm(553): threadid=15: thread exiting with uncaught exception (group=0x4001b188)
    04-27 10:51:50.746: E/AndroidRuntime(553): Uncaught handler: thread AsyncTask #1 exiting due to uncaught exception
    04-27 10:51:50.846: E/AndroidRuntime(553): java.lang.RuntimeException: An error occured while executing doInBackground()
    04-27 10:51:50.846: E/AndroidRuntime(553):  at android.os.AsyncTask$3.done(AsyncTask.java:200)
    04-27 10:51:50.846: E/AndroidRuntime(553):  at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
    04-27 10:51:50.846: E/AndroidRuntime(553):  at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
    04-27 10:51:50.846: E/AndroidRuntime(553):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
    04-27 10:51:50.846: E/AndroidRuntime(553):  at java.util.concurrent.FutureTask.run(FutureTask.java:137)
    04-27 10:51:50.846: E/AndroidRuntime(553):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
    04-27 10:51:50.846: E/AndroidRuntime(553):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
    04-27 10:51:50.846: E/AndroidRuntime(553):  at java.lang.Thread.run(Thread.java:1096)
    04-27 10:51:50.846: E/AndroidRuntime(553): Caused by: java.lang.NoClassDefFoundError: org.jdom.input.SAXBuilder
    04-27 10:51:50.846: E/AndroidRuntime(553):  at com.pkg.src.nhs.glos.MainActivity$SetImageTask.doInBackground(MainActivity.java:100)
    04-27 10:51:50.846: E/AndroidRuntime(553):  at com.pkg.src.nhs.glos.MainActivity$SetImageTask.doInBackground(MainActivity.java:1)
    04-27 10:51:50.846: E/AndroidRuntime(553):  at android.os.AsyncTask$2.call(AsyncTask.java:185)
    04-27 10:51:50.846: E/AndroidRuntime(553):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
    04-27 10:51:50.846: E/AndroidRuntime(553):  ... 4 more
    04-27 10:51:50.941: I/dalvikvm(553): threadid=7: reacting to signal 3
    04-27 10:51:50.941: E/dalvikvm(553): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
    04-27 10:52:02.038: I/Process(553): Sending signal. PID: 553 SIG: 9
答案

检查是否在构建路径设置的“订购和导出”选项卡中选中了jdom库。如果没有检查,请执行清理并重试运行您的应用程序。

另一答案

在Android Studio中,它必须自动添加您添加到项目中“libs”文件夹的jar文件,但有时它不会这样做。所以你必须为Windows用户转到“项目结构”= ctrl + alt + shift + S.

然后单击面板左侧的“app”。然后单击“依赖关系”选项卡。然后单击(+) - > jar依赖项。然后在libs文件夹中选择你的jar文件。

然后单击确定。

以上是关于android异常,即使jdom库存在的主要内容,如果未能解决你的问题,请参考以下文章

片段还是支持片段?

片段中的Android致命异常

Xamarin Android 片段库

选项卡执行android中下一个片段中存在的代码

为什么groovy方法不打印该文件不存在?

java.lang.NullPointerException: Attempt to invoke virtual method ‘int android.database.sqlite异常(代码片段