So I am making an Android app. Essentially what it does, is it fetches the user's longitude and latitude vid the network provider. It then passes that to a method which uses a geocoder to get back the zip code. Once I have the zip code, I make a request to WunderGround and get back the forecast a JSON. I then use GSON to parse it up, and get each Day's Date, Temp(F) and Conditions.
HOWEVER, my app keeps crashing, and I have no idea why. LogCat only tells me that it is in 'FutureTask'. I Googled that and it has something to do with threads, so I am assuming something in my Async is off.
If anyone can take a look at my code and give me some advice on how to fix this I would appreciate it.
CODE OMITTED (NO LONGER NECESSARY)
LOGCAT:
02-20 22:53:38.632: I/Adreno-EGL(31953): <qeglDrvAPI_eglInitialize:316>: EGL 1.4 QUALCOMM build: (CL4169980)
02-20 22:53:38.632: I/Adreno-EGL(31953): OpenGL ES Shader Compiler Version: 17.01.10.SPL
02-20 22:53:38.632: I/Adreno-EGL(31953): Build Date: 09/26/13 Thu
02-20 22:53:38.632: I/Adreno-EGL(31953): Local Branch:
02-20 22:53:38.632: I/Adreno-EGL(31953): Remote Branch:
02-20 22:53:38.632: I/Adreno-EGL(31953): Local Patches:
02-20 22:53:38.632: I/Adreno-EGL(31953): Reconstruct Branch:
02-20 22:53:42.846: E/dalvikvm(31953): Could not find class 'com.google.gson.JsonParser', referenced from method com.example.midterm2.MainActivity$parseJSON.doInBackground
02-20 22:53:42.846: W/dalvikvm(31953): VFY: unable to resolve new-instance 738 (Lcom/google/gson/JsonParser;) in Lcom/example/midterm2/MainActivity$parseJSON;
02-20 22:53:42.886: W/dalvikvm(31953): threadid=12: thread exiting with uncaught exception (group=0x417a0898)
02-20 22:53:42.936: E/AndroidRuntime(31953): FATAL EXCEPTION: AsyncTask #1
02-20 22:53:42.936: E/AndroidRuntime(31953): java.lang.RuntimeException: An error occured while executing doInBackground()
02-20 22:53:42.936: E/AndroidRuntime(31953): at android.os.AsyncTask$3.done(AsyncTask.java:299)
02-20 22:53:42.936: E/AndroidRuntime(31953): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
02-20 22:53:42.936: E/AndroidRuntime(31953): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
02-20 22:53:42.936: E/AndroidRuntime(31953): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
02-20 22:53:42.936: E/AndroidRuntime(31953): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
02-20 22:53:42.936: E/AndroidRuntime(31953): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
02-20 22:53:42.936: E/AndroidRuntime(31953): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
02-20 22:53:42.936: E/AndroidRuntime(31953): at java.lang.Thread.run(Thread.java:841)
02-20 22:53:42.936: E/AndroidRuntime(31953): Caused by: java.lang.NoClassDefFoundError: com.google.gson.JsonParser
02-20 22:53:42.936: E/AndroidRuntime(31953): at com.example.midterm2.MainActivity$parseJSON.doInBackground(MainActivity.java:197)
02-20 22:53:42.936: E/AndroidRuntime(31953): at com.example.midterm2.MainActivity$parseJSON.doInBackground(MainActivity.java:1)
02-20 22:53:42.936: E/AndroidRuntime(31953): at android.os.AsyncTask$2.call(AsyncTask.java:287)
02-20 22:53:42.936: E/AndroidRuntime(31953): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
02-20 22:53:42.936: E/AndroidRuntime(31953): ... 4 more