what does this error means? - android

i got lots of crashes on lots of devices but on my device(lg p920) it works fine. the below report is from goggle play my app crashed and got 6 reports. by the way i use sql pre created database.and also created android_metadata table and locale en_US also inserted to that database.
this is the STACK TRACES:
android.database.sqlite.SQLiteDiskIOException: disk I/O error
at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:2074)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1014)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:986)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:962)
at offline.sinhaladic.com.MainActivity.sugen(MainActivity.java:1312)
at offline.sinhaladic.com.MainActivity$7.afterTextChanged(MainActivity.java:972)
at android.widget.TextView.sendAfterTextChanged(TextView.java:7665)
at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:8067)
at android.text.SpannableStringBuilder.sendTextHasChanged(SpannableStringBuilder.java:900)
at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:353)
at android.text.SpannableStringBuilder.change(SpannableStringBuilder.java:266)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:443)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:420)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:29)
at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:663)
at android.view.inputmethod.BaseInputConnection.setComposingText(BaseInputConnection.java:425)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:333)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:77)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)

Reference : https://stackoverflow.com/a/4828540/1318946
One thought that popped up is the hard coded path to where the
database file is located. DB_PATH =
“/data/data/YOUR_PACKAGE/databases/”;
I guess it is possible that this path isn’t valid on Android 2.2.1 for
Desire HD. I exchanged this path with: Environment.getDataDirectory()
+ “/data/YOUR_PACKAGE/databases/” + DB_NAME;
I’ll try to pin point the issue when I had the chance to test on the
actual phone myself. If anyone test this solution, please let me know
if it solves it.

This is not a common error you'll see. It can happen rarely on some device with low internal memory. While your app was trying to write to DB, it ran out of internal memory and failed to write. What you can do is check the available storage and if its really dropping to zero, notify user.

SQLiteDiskIOException
java.lang.Object
↳ java.lang.Throwable
↳ java.lang.Exception
↳ java.lang.RuntimeException
↳ android.database.SQLException
↳ android.database.sqlite.SQLiteException
↳ android.database.sqlite.SQLiteDiskIOException
An exception that indicates that an IO error occured while accessing the SQLite database file.
Reference: SQLiteDiskIOException.

Related

Openh264 throws UnsatisfiedLinkError

Today we got a strange crash. During the first installation the app downloads and unzips openh264 to the internal directory of the app, happens on a Schedulers.io() thread from rxAndroid.
This is the first crash of this kind (>5k installations) and I found this link (very interesting blog by the way) with a matching error message. I'm not sure if really someone tried to replace the openH264 lib or if someone tried to install the apk file on a x86 device. I'm still using 1.4 of openH264 and have read the 1.5 release notes. There is no hint of security fixes.
Some more details about the device:
Android: 4.3
Manufacturer: Samsung
Model: GT-I9300
And finally, here is the crash log:
java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:62)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/data/path/files/libopenh264.so" has bad ELF magic
at java.lang.Runtime.load(Runtime.java:330)
at java.lang.System.load(System.java:511)
at path.BeatMarker.init(BeatMarker.java:33)
at path.fragments.main.MainFragment.onOpenH264Done(MainFragment.java:475)
at path.fragments.main.MainPresenterImpl.onOpenH264Done(MainPresenterImpl.java:25)
at path.fragments.main.MainLoaderImpl$1.onCompleted(MainLoaderImpl.java:61)
at rx.observers.SafeSubscriber.onCompleted(SafeSubscriber.java:81)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.pollQueue(OperatorObserveOn.java:201)
at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber$2.call(OperatorObserveOn.java:170)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
... 9 more
I'm pretty sure, the crash happens here:
at path.BeatMarker.init(BeatMarker.java:33)
These are the lines:
File libOpenH264File = new File(context.getFilesDir(), "libopenh264.so");
System.load(libOpenH264File.getAbsolutePath()); //line 33
Gets called, when the download and unzip is completed.
Can the error occur, while the lib is downloading and the network connection get lost?
Any help or hint is welcome, thanks in advance! :)

NullPointerException when getting Image Cache

I'm using classes from Android's BitmapFun sample code and have been running into a problem with certain devices(My app doesn't crash on all the devices I have tested, but on other peoples).
Note: The version of Android which this happens on has been: 2.3.3-2.3.7, 4.0.3-4.0.4, 4.1 and 4.2
In my Google developer console, I getting the following stack trace:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.question/com.question.ui.question}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2077)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
at android.app.ActivityThread.access$600(ActivityThread.java:134)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4624)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.question.util.ImageCache.getDiskCacheDir(ImageCache.java:568)
at com.question.util.ImageCache$ImageCacheParams.<init>(ImageCache.java:488)
at com.question.ui.question.onCreate(question.java:58)
at android.app.Activity.performCreate(Activity.java:4479)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2041)
... 11 more
I have looked into this and have found a question with the same problem. I have made some adjustments that are suggested from that answer and same problem still persists.
Code that is causing the problem:
public static File getDiskCacheDir(Context context, String uniqueName) {
// Check if media is mounted or storage is built-in, if so, try and use external cache dir
// otherwise use internal cache dir
final String cachePath =
Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) ||
!isExternalStorageRemovable() ? getExternalCacheDir(context).getPath() :
context.getCacheDir().getPath();
return new File(cachePath + File.separator + uniqueName);
}
if anyone would know what the issue is here and could explain, that would be of help!
I experienced this issue and discovered my AVD emulator was not configured correctly. Specifically, the null pointer is due to the lack of storage space defined and assigned to the Virtual Device.
To fix the problem create a new or edit your Android Virtual Device with SD Card storage. In Eclipse: Select the Andoid Virtual Device Manager ICON=> Create New=>... Near the bottom of the page is a section called SD Card: Enter a value for SD Card size.
Here is a link that describes how to configure the AVD emulator with the proper storage.
Here is a link that provides a good technical definition why the NullPointerException is generated.

App force closes with java.lang.NoClassDefFoundError: android/os/AsyncTask

We recently introduced OAuth login in our app. This means using a WebView to authenticate the user, and an AsyncTask to do necessary REST calls afterwards.
Unfortunately, after introducing this login method, we're getting reports of the app force closing. This seems to be related to other AsyncTasks that are executed after the login, but the stack traces does unfortunately not tell us much:
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3100)
at android.view.View.performClick(View.java:3627)
at android.view.View$PerformClick.run(View.java:14329)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4511)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3095)
... 11 more
Caused by: java.lang.NoClassDefFoundError: android/os/AsyncTask
at com.foo.bar.TransmissionActivity.transmit(TransmissionActivity.java:44)
... 14 more
We managed to fix the error above by using RoboAsyncTask (from RoboGuice), instead of AsyncTask from the Android SDK, but we have other activities that use WebViews. WebView apparently uses AsyncTask somewhere in its call stack, and errors similar the one shown above (Caused by: java.lang.NoClassDefFoundError: android/os/AsyncTask) have started to show in our error logs.
The error happens on different devices, and different Android versions, with no apparent pattern. We have tried to reproduce the error ourselves, without any luck.
Any ideas?
It might be an issue with the build setup. (Build order of src/gen has been known to cause some issues, the libs folder for the compat library being called lib has caused some issues for me on new sdk versions).
To see if it is create a new project (in eclipse, since that's 100% android official). Add a webview and an asynctask and then do a diff on the project with your project. Ignoring src/gen/res. Hopefully you'll find that the src/gen are built in the wrong order or something like that.
~ Anders

IndexOutOfBoundsException at android.graphics.Paint.native_measureText(Native Method)

I have an android app on Google Play and occasionally get the following error reported through the developer console / ACRA. The app runs fine on my test devices and on the various AVDs that I test it on.
The stack trace doesn't state where in the app the problem is. Is there anything I can do to narrow down where to look? What generally causes the error?
java.lang.IndexOutOfBoundsException
at android.graphics.Paint.native_measureText(Native Method)
at android.graphics.Paint.measureText(Paint.java:1020)
at android.graphics.Paint.measureText(Paint.java:1057)
at android.text.Styled.drawDirectionalRun(Styled.java:267)
at android.text.Styled.measureText(Styled.java:430)
at android.text.Layout.measureText(Layout.java:1518)
at android.text.Layout.getHorizontal(Layout.java:564)
at android.text.Layout.getHorizontal(Layout.java:548)
at android.text.Layout.getPrimaryHorizontal(Layout.java:533)
at android.widget.TextView$QuickAction.getBound(TextView.java:9550)
at android.widget.TextView$QuickAction.show(TextView.java:9604)
at android.widget.TextView$QuickActionController.show(TextView.java:8846)
at android.widget.TextView.performLongClick(TextView.java:8033)
at android.view.View$CheckForLongPress.run(View.java:9096)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3701)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller
.run(ZygoteInit.java:895)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653)
at dalvik.system.NativeStart.main(Native Method)
From the look of this, you have a race in your application initialization block. Probably one of your text resources is not fully inflated before a draw is issued. (i know, the model of the android runtime should prevent this, but if this happens when the layout is calculated, it would be plausible).
Hope this is of some help in narrowing it down.

Resources$NotFoundException report from wild

I just released an update and got an exception report from the wild after someone updated a previously working application.
The same code works on my phone, the resource is a raw file and not dependent on device, local dependent or anything.
I had a similar thing happen before while developing the update, I cleaned the project and it resolved it.
However this doesn't seem to be a good solution as I cannot verify the fix, don't want to just shove a version out in case it fixes the issue.
Any advice as to cause or resolution would be massively appreciated!
Stack Trace below:
java.lang.RuntimeException: Unable to create service com.beltane.apppro.TickerService:
android.content.res.Resources$NotFoundException: Resource ID #0x7f040005 at
android.app.ActivityThread.handleCreateService(ActivityThread.java:2969) at
android.app.ActivityThread.access$3300(ActivityThread.java:125) at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087) at
android.os.Handler.dispatchMessage(Handler.java:99) at
android.os.Looper.loop(Looper.java:123) at
android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method) at
java.lang.reflect.Method.invoke(Method.java:521) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) at
dalvik.system.NativeStart.main(Native Method) Caused by:
android.content.res.Resources$NotFoundException: Resource ID #0x7f040005 at
android.content.res.Resources.getValue(Resources.java:892) at
android.content.res.Resources.openRawResourceFd(Resources.java:854) at
android.media.MediaPlayer.create(MediaPlayer.java:647) at
com.beltane.apppro.TickerService.onCreate(TickerService.java:42) at
android.app.ActivityThread.handleCreateService(ActivityThread.java:2959) ... 10 more
For anyone facing a similar problem my resolution as horrible as it is:
Prepare a new release deleting all intermediate generated files, doing a clean build and re-releasing.
I trapped all media player creation code in try catch blocks for resource not found exceptions and pop up a toast explaining to the user what has occurred and to contact for a resolution.
This is pretty nasty but given that this should never occur...
I haven't heard either way from the user that returned the crash report, I have had other good feedback since, I'll update if I hear further either way.

Categories

Resources