fatal exception asyncClass #3 - android

11-05 00:07:20.204: E/AndroidRuntime(892): FATAL EXCEPTION: AsyncTask #3
11-05 00:07:20.204: E/AndroidRuntime(892): java.lang.RuntimeException: An error occured while executing doInBackground()
11-05 00:07:20.204: E/AndroidRuntime(892): at android.os.AsyncTask$3.done(AsyncTask.java:299)
11-05 00:07:20.204: E/AndroidRuntime(892): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
11-05 00:07:20.204: E/AndroidRuntime(892): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
11-05 00:07:20.204: E/AndroidRuntime(892): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
11-05 00:07:20.204: E/AndroidRuntime(892): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
11-05 00:07:20.204: E/AndroidRuntime(892): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
11-05 00:07:20.204: E/AndroidRuntime(892): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
11-05 00:07:20.204: E/AndroidRuntime(892): at java.lang.Thread.run(Thread.java:841)
11-05 00:07:20.204: E/AndroidRuntime(892): Caused by: java.lang.VerifyError: net/sourceforge/jtds/jdbc/TdsCore
11-05 00:07:20.204: E/AndroidRuntime(892): at net.sourceforge.jtds.jdbc.JtdsConnection.<init>(JtdsConnection.java:359)
11-05 00:07:20.204: E/AndroidRuntime(892): at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
11-05 00:07:20.204: E/AndroidRuntime(892): at java.sql.DriverManager.getConnection(DriverManager.java:179)
11-05 00:07:20.204: E/AndroidRuntime(892): at java.sql.DriverManager.getConnection(DriverManager.java:144)
11-05 00:07:20.204: E/AndroidRuntime(892): at com.example.zzzsqldb.ConnectionClass.CONN(ConnectionClass.java:34)
11-05 00:07:20.204: E/AndroidRuntime(892): at com.example.zzzsqldb.MainActivity$DoLogin.doInBackground(MainActivity.java:72)
11-05 00:07:20.204: E/AndroidRuntime(892): at com.example.zzzsqldb.MainActivity$DoLogin.doInBackground(MainActivity.java:1)
11-05 00:07:20.204: E/AndroidRuntime(892): at android.os.AsyncTask$2.call(AsyncTask.java:287)
11-05 00:07:20.204: E/AndroidRuntime(892): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
11-05 00:07:20.204: E/AndroidRuntime(892): ... 4 more

Related

Android App get Stopped When Changing the orientation

I am creating an Android app. I want it to work in both orientations. When I run it in landscape mode it works well but while changing it to portrait,the app stopped. again I open it will work normally. this is my problem. when I change the orientation. First time it shows error. help me to solve this issue.
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: java.lang.RuntimeException: An error occured while executing doInBackground()
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at android.os.AsyncTask$3.done(AsyncTask.java:299)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:239)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at java.lang.Thread.run(Thread.java:856)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: Caused by: java.lang.OutOfMemoryError
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:529)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:302)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at com.infizoom.smartselfie2.Helper.decodeSampledBitmapFromPath(Helper.java:32)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at com.infizoom.smartselfie2.FrameActivity.LoadImagesFromLocalDb(FrameActivity.java:195)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at com.infizoom.smartselfie2.FrameActivity$LoadImagesIntoLocal.doInBackground(FrameActivity.java:136)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at com.infizoom.smartselfie2.FrameActivity$LoadImagesIntoLocal.doInBackground(FrameActivity.java:114)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at android.os.AsyncTask$2.call(AsyncTask.java:287)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at java.util.concurrent.FutureTask.run(FutureTask.java:234)
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
11-05 16:40:44.010 10204-10250/com.infizoom.smartselfie2 E/AndroidRuntime: at java.lang.Thread.run(Thread.java:856) 
You are getting an OutOfMemory exception when your activity gets recreated after orientation change.
I could guess in your FrameActivity you are leaking bitmaps on every activity creation not allowing the GC to free up enough memory.

Caused by: java.lang.NoClassDefFoundError: com.google.android.gms.gcm.GoogleCloudMessaging using flex

I am developing an Android native extension for push notification. I have added the gcm library to the class path but the class GoogleCloudMessaging could not be found. Even thought the jar from google is added to the class path of the android project, I still get the error message, so after I export the jar I am updating with the classes from the Google gcm jar. After this everything looks ok at jar level but the problem still persist and I have the following error:
W/dalvikvm(10513): VFY: unable to resolve static method 2592: Lcom/google/android/gms/gcm/GoogleCloudMessaging;.getInstance (Landroid/content/Context;)Lcom/google/android/gms/gcm/GoogleCloudMessaging;
08-17 19:32:10.328: W/dalvikvm(10513): threadid=16: thread exiting with uncaught exception (group=0x40adb9f0)
08-17 19:32:10.348: E/AndroidRuntime(10513): FATAL EXCEPTION: AsyncTask #1
08-17 19:32:10.348: E/AndroidRuntime(10513): java.lang.RuntimeException: An error occured while executing doInBackground()
08-17 19:32:10.348: E/AndroidRuntime(10513): at android.os.AsyncTask$3.done(AsyncTask.java:278)
08-17 19:32:10.348: E/AndroidRuntime(10513): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
08-17 19:32:10.348: E/AndroidRuntime(10513): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
08-17 19:32:10.348: E/AndroidRuntime(10513): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
08-17 19:32:10.348: E/AndroidRuntime(10513): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
08-17 19:32:10.348: E/AndroidRuntime(10513): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
08-17 19:32:10.348: E/AndroidRuntime(10513): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-17 19:32:10.348: E/AndroidRuntime(10513): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
08-17 19:32:10.348: E/AndroidRuntime(10513): at java.lang.Thread.run(Thread.java:856)
08-17 19:32:10.348: E/AndroidRuntime(10513): Caused by: java.lang.NoClassDefFoundError: com.google.android.gms.gcm.GoogleCloudMessaging
08-17 19:32:10.348: E/AndroidRuntime(10513): at com.microsoft.windowsazure.notifications.NotificationsManager$1.doInBackground(NotificationsManager.java:43)
08-17 19:32:10.348: E/AndroidRuntime(10513): at com.microsoft.windowsazure.notifications.NotificationsManager$1.doInBackground(NotificationsManager.java:1)
08-17 19:32:10.348: E/AndroidRuntime(10513): at android.os.AsyncTask$2.call(AsyncTask.java:264)
08-17 19:32:10.348: E/AndroidRuntime(10513): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
08-17 19:32:10.348: E/AndroidRuntime(10513): ... 5 more

"Unfortunately, MainScreenActivity has stopped" ERROR message in Android Emulator

I tried doing this code from this site: http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/ . Everything worked out properly but when i tried to VIEW and ADD products the emulator goes "Unfortunately, MainScreenActivity has stopped.
help please?? :D
here is my logcat file:
06-26 15:53:16.227: E/AndroidRuntime(1396): FATAL EXCEPTION: AsyncTask #1
06-26 15:53:16.227: E/AndroidRuntime(1396): java.lang.RuntimeException: An error occured while executing doInBackground()
06-26 15:53:16.227: E/AndroidRuntime(1396): at android.os.AsyncTask$3.done(AsyncTask.java:299)
06-26 15:53:16.227: E/AndroidRuntime(1396): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
06-26 15:53:16.227: E/AndroidRuntime(1396): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
06-26 15:53:16.227: E/AndroidRuntime(1396): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
06-26 15:53:16.227: E/AndroidRuntime(1396): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
06-26 15:53:16.227: E/AndroidRuntime(1396): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
06-26 15:53:16.227: E/AndroidRuntime(1396): at java.lang.Thread.run(Thread.java:856)
06-26 15:53:16.227: E/AndroidRuntime(1396): Caused by: java.lang.IllegalArgumentException: Illegal character in authority at index 15: http://10.0.2.2 /try/get_all_products.php?
06-26 15:53:16.227: E/AndroidRuntime(1396): at java.net.URI.create(URI.java:727)
06-26 15:53:16.227: E/AndroidRuntime(1396): at org.apache.http.client.methods.HttpGet.<init>(HttpGet.java:75)
06-26 15:53:16.227: E/AndroidRuntime(1396): at com.example.mainscreenactivity.JSONParser.makeHttpRequest(JSONParser.java:60)
06-26 15:53:16.227: E/AndroidRuntime(1396): at com.example.mainscreenactivity.AllProductsActivity$LoadAllProducts.doInBackground(AllProductsActivity.java:128)
06-26 15:53:16.227: E/AndroidRuntime(1396): at com.example.mainscreenactivity.AllProductsActivity$LoadAllProducts.doInBackground(AllProductsActivity.java:1)
06-26 15:53:16.227: E/AndroidRuntime(1396): at android.os.AsyncTask$2.call(AsyncTask.java:287)
06-26 15:53:16.227: E/AndroidRuntime(1396): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
06-26 15:53:16.227: E/AndroidRuntime(1396): ... 3 more
06-26 15:53:16.570: W/ActivityManager(276): Force finishing activity com.example.mainscreenactivity/.AllProductsActivity
06-26 15:53:16.737: W/WindowManager(276): Failure taking screenshot for (266x425) to layer 21020
You have a space character after the ip address: http://10.0.2.2*/

Activity started without an EXTRA_ACCOUNT when using native sharing on GooglePlus SDK

I have a Google+ connection in my app, and when I try to get the user's information with a Person Object, everything works just fine.
but when I'm using the Share dialog as stated in the documentation, I get a crash in the G+ library.
here is the code I'm using for this:
Intent shareIntent = new PlusShare.Builder(getActivity())
.setType("text/plain")
.setText(getString(R.string.application_sharing_default_share_with_friends))
.setContentUrl(Uri.parse(shareLink))
.getIntent();
startActivityForResult(shareIntent, 0);
and when I run this all I get is this error and crash:
11-05 11:30:51.093: E/AndroidRuntime(617): FATAL EXCEPTION: main
11-05 11:30:51.093: E/AndroidRuntime(617): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.google.android.apps.plus/com.google.android.apps.plus.phone.ShareActivity}: java.lang.IllegalStateException: Activity started without an EXTRA_ACCOUNT
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread.access$600(ActivityThread.java:130)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.os.Handler.dispatchMessage(Handler.java:99)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.os.Looper.loop(Looper.java:137)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread.main(ActivityThread.java:4745)
11-05 11:30:51.093: E/AndroidRuntime(617): at java.lang.reflect.Method.invokeNative(Native Method)
11-05 11:30:51.093: E/AndroidRuntime(617): at java.lang.reflect.Method.invoke(Method.java:511)
11-05 11:30:51.093: E/AndroidRuntime(617): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-05 11:30:51.093: E/AndroidRuntime(617): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-05 11:30:51.093: E/AndroidRuntime(617): at dalvik.system.NativeStart.main(Native Method)
11-05 11:30:51.093: E/AndroidRuntime(617): Caused by: java.lang.IllegalStateException: Activity started without an EXTRA_ACCOUNT
11-05 11:30:51.093: E/AndroidRuntime(617): at brz.onCreate(PG:169)
11-05 11:30:51.093: E/AndroidRuntime(617): at com.google.android.apps.plus.phone.PostActivity.onCreate(PG:77)
11-05 11:30:51.093: E/AndroidRuntime(617): at com.google.android.apps.plus.phone.ShareActivity.onCreate(PG:156)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.Activity.performCreate(Activity.java:5008)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
11-05 11:30:51.093: E/AndroidRuntime(617): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
11-05 11:30:51.093: E/AndroidRuntime(617): ... 11 more
This was a bug in the Google+ app that is fixed in the latest build that came out today: https://plus.google.com/101870761930221849874/posts/KohXe9pBGF6 Sorry about that.
Check your g+ app first, it is likely the g+ account is not completely set up. Go to the g+ and follow the steps to have at least one g+ account set up and the error should be gone.

Update list with RSS data

I am working on displaying some RSS data in a ListView. I was reading up on the onProgressUpdate() method provided by the Asynchronous task class.
I was wondering if it would be possible to use this method to update the listview as each item from XML is retrieved?
I overrided the method here:
#Override
protected void onProgressUpdate(Integer... values) {
adapter.notifyDataSetChanged();
}
I am getting this error:
Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
Any ideas where I am going wrong?
EDIT: I just read an article saying this error is generated from trying to update the UI thread from within the background thread inside of the doInBackground() method. In my case I am calling the onProgressUpdate() in the doInBackground() method. I was trying to add the effect of the list populating as each item was downloaded.
Any suggestions of how I could achieve this would be great!
Log cat:
01-13 00:41:09.195: E/AndroidRuntime(32239): FATAL EXCEPTION: AsyncTask #1
01-13 00:41:09.195: E/AndroidRuntime(32239): java.lang.RuntimeException: An error occured while executing doInBackground()
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.os.AsyncTask$3.done(AsyncTask.java:299)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.FutureTask.setException(FutureTask.java:219)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.FutureTask.run(FutureTask.java:239)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.lang.Thread.run(Thread.java:856)
01-13 00:41:09.195: E/AndroidRuntime(32239): Caused by: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:4746)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:823)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.View.requestLayout(View.java:15468)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.View.requestLayout(View.java:15468)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.View.requestLayout(View.java:15468)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.View.requestLayout(View.java:15468)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.RelativeLayout.requestLayout(RelativeLayout.java:318)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.view.View.requestLayout(View.java:15468)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.AbsListView.requestLayout(AbsListView.java:1819)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.AdapterView$AdapterDataSetObserver.onChanged(AdapterView.java:813)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.AbsListView$AdapterDataSetObserver.onChanged(AbsListView.java:5958)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.database.DataSetObservable.notifyChanged(DataSetObservable.java:37)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.BaseAdapter.notifyDataSetChanged(BaseAdapter.java:50)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.widget.ArrayAdapter.notifyDataSetChanged(ArrayAdapter.java:286)
01-13 00:41:09.195: E/AndroidRuntime(32239): at com.example.simplerss.MainActivity$PostTask.onProgressUpdate(MainActivity.java:148)
01-13 00:41:09.195: E/AndroidRuntime(32239): at com.example.simplerss.MainActivity$PostTask.doInBackground(MainActivity.java:123)
01-13 00:41:09.195: E/AndroidRuntime(32239): at com.example.simplerss.MainActivity$PostTask.doInBackground(MainActivity.java:1)
01-13 00:41:09.195: E/AndroidRuntime(32239): at android.os.AsyncTask$2.call(AsyncTask.java:287)
01-13 00:41:09.195: E/AndroidRuntime(32239): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
01-13 00:41:09.195: E/AndroidRuntime(32239): ... 4 more
In my case I am calling the onProgressUpdate() in the doInBackground()
method.
You have to call publishProgress() instead. If you directly call onProgressUpdate(), that is still running from the background thread and so, will fail.
You should take a look at the AsyncTask documentation, they provide an example.

Categories

Resources