鹅NoClassDefFoundError

时间:2015-02-16 16:37:35

标签: javascript android goose

我正在尝试将Goose-2.1.22实现到我的一个应用程序中。但是,当我尝试使用他们提供的基本代码运行我的应用程序时,我收到此错误:

02-16 11:19:55.048  29391-29391/test.package.test2 E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.gravity.goose.Goose
        at test.package.test2.Searching_Animation_Screen.goose_it(Searching_Animation_Screen.java:65)
        at test.package.test2.Searching_Animation_Screen.onCreate(Searching_Animation_Screen.java:59)
        at android.app.Activity.performCreate(Activity.java:5372)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2359)
        at android.app.ActivityThread.access$700(ActivityThread.java:165)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1326)\

以下是使用goose的代码(从onCreate()调用的方法)

String url = "http://www.cnn.com/2010/POLITICS/08/13/democrats.social.security/index.html";
    Goose goose = new Goose(new Configuration());
    Article article = goose.extractContent(url);
    System.out.println(article.cleanedArticleText());
    text.setText(article.cleanedArticleText().toString());

任何想法如何解决我的问题?谢谢大家!

1 个答案:

答案 0 :(得分:0)

似乎库(jar)不在你的APK中。

如果您使用Eclipse,请右键单击您的项目,选择“Java build Path”,选中Goose jar在“Libraries”选项卡中,在“Order& export”选项卡中,Goose lib必须存在并检查。