Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: Parsing a page with Jsoup
    primarykey
    data
    text
    <p>Why does my app keep crashing after it shows up on the Emulator? I just started learning about Jsoup parsing and following different tuts, but I can't find solution to this error. </p> <pre><code>package com.example.testingjson; import java.io.IOException; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import android.os.Bundle; import android.app.Activity; import android.view.Menu; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // process Document doc; try { doc = Jsoup.connect("http://google.com/").get(); String title = doc.title(); System.out.print(title); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_main, menu); return true; } } </code></pre> <p>And this is the Error Message</p> <pre><code>12-26 19:30:42.043: E/AndroidRuntime(4260): FATAL EXCEPTION: main 12-26 19:30:42.043: E/AndroidRuntime(4260): java.lang.NoClassDefFoundError: org.jsoup.Jsoup 12-26 19:30:42.043: E/AndroidRuntime(4260): at com.example.testingjson.MainActivity.onCreate(MainActivity.java:22) 12-26 19:30:42.043: E/AndroidRuntime(4260): at android.app.Activity.performCreate(Activity.java:5104) 12-26 19:30:42.043: E/AndroidRuntime(4260): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 12-26 19:30:42.043: E/AndroidRuntime(4260): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) 12-26 19:30:42.043: E/AndroidRuntime(4260): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 12-26 19:30:42.043: E/AndroidRuntime(4260): at android.app.ActivityThread.access$600(ActivityThread.java:141) 12-26 19:30:42.043: E/AndroidRuntime(4260): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 12-26 19:30:42.043: E/AndroidRuntime(4260): at android.os.Handler.dispatchMessage(Handler.java:99) 12-26 19:30:42.043: E/AndroidRuntime(4260): at android.os.Looper.loop(Looper.java:137) 12-26 19:30:42.043: E/AndroidRuntime(4260): at android.app.ActivityThread.main(ActivityThread.java:5039) 12-26 19:30:42.043: E/AndroidRuntime(4260): at java.lang.reflect.Method.invokeNative(Native Method) 12-26 19:30:42.043: E/AndroidRuntime(4260): at java.lang.reflect.Method.invoke(Method.java:511) 12-26 19:30:42.043: E/AndroidRuntime(4260): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 12-26 19:30:42.043: E/AndroidRuntime(4260): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 12-26 19:30:42.043: E/AndroidRuntime(4260): at dalvik.system.NativeStart.main(Native Method) </code></pre> <p>Edit: Here is a pic showing the JSOUP jar file imported, but I still get the error. <img src="https://i.stack.imgur.com/MFmkU.png" alt="enter image description here"></p> <p>APK file opened with Winrar.</p> <p><img src="https://i.stack.imgur.com/YQrxA.png" alt="enter image description here"></p> <p>Order &amp; Export' settings </p> <p><img src="https://i.stack.imgur.com/a974W.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload