6

我收到此错误:

03-04 09:55:55.915: W/dalvikvm(20171): Exception Ljava/lang/NullPointerException; thrown while initializing La/a/b/k;
03-04 09:55:55.915: W/dalvikvm(20171): Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing La/a/b/l;
03-04 09:55:55.925: W/dalvikvm(20171): threadid=13: thread exiting with uncaught exception (group=0x40ab3300)
03-04 09:55:55.945: E/AndroidRuntime(20171): FATAL EXCEPTION: AsyncTask #1
03-04 09:55:55.945: E/AndroidRuntime(20171): java.lang.RuntimeException: An error occured while executing doInBackground()
03-04 09:55:55.945: E/AndroidRuntime(20171):    at android.os.AsyncTask$3.done(AsyncTask.java:299)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at java.util.concurrent.FutureTask.run(FutureTask.java:137)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at java.lang.Thread.run(Thread.java:856) 03-04 09:55:55.945: E/AndroidRuntime(20171): Caused by: java.lang.ExceptionInInitializerError
03-04 09:55:55.945: E/AndroidRuntime(20171):    at a.a.b.f.<init>(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at a.a.b.e.<init>(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at a.a.c.dh.b(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at a.a.c.dh.a(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at a.a.c.b.a(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at a.a.c.ad.a(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at a.a.a.a(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at com.taco.bezoekerspasparkeren.c.a(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at com.taco.bezoekerspasparkeren.c.doInBackground(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at android.os.AsyncTask$2.call(AsyncTask.java:287)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
03-04 09:55:55.945: E/AndroidRuntime(20171):    ... 5 more
03-04 09:55:55.945: E/AndroidRuntime(20171): Caused by: java.lang.ExceptionInInitializerError
03-04 09:55:55.945: E/AndroidRuntime(20171):    at a.a.b.l.<clinit>(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    ... 16 more
03-04 09:55:55.945: E/AndroidRuntime(20171): Caused by: java.lang.NullPointerException
03-04 09:55:55.945: E/AndroidRuntime(20171):    at java.util.Properties.load(Properties.java:246)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at a.a.b.k.d(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    at a.a.b.k.<clinit>(Unknown Source)
03-04 09:55:55.945: E/AndroidRuntime(20171):    ... 17 more
03-04 09:55:55.995: W/ActivityManager(265):   Force finishing activity com.taco.bezoekerspasparkeren/.BezoekerspasActivity

使用这段代码:

class Subscribe extends AsyncTask<String, Void, Result> {

        @Override
        protected Result doInBackground(String... s) {
            // ...

            Document test = Jsoup.parse("<html></html>"); // explodes here
        }
}

这仅在发布模式下。我正在使用 Jsoup 1.7.2。怎么了?我怎么能看到错误在“... 17 more”中崩溃了,因为我猜线索就在那里...

这与仅在运行发布 apk 时使用 AsyncTask的错误相同的问题...请帮助 :(但未得到答复。

这个让我崩溃了!

4

1 回答 1

12

这确实是 ProGuard 的一个混淆问题(如果问题仅在发布模式下存在,这是合乎逻辑的),我必须在 proguard 文件中添加以下内容:

-keep public class org.jsoup.** {
    public *;
}
于 2013-03-04T10:42:11.823 回答