Hi,
I'm working on a project with one activity, many classes , services and SQL databases. the app suppose to constantly running in the background and the user may get the GUI by demand.
The app is running well the most of the time but I'm facing random crashes related to SQL DBs (not always in the same DB).
I validated all objects were well declared and initialized in all sequences to the crash.
Crashes occurs mostly when GUI is not visible and the App is in background for a long time. I cannot recall crashes during interactive work with the app.
There is not difference if databases are in internal or external storage.
The following is a log of a typical crash:
** Activity (main) Resume **
android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14)
at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method)
at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:845)
at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)
at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:144)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:133)
at anywheresoftware.b4a.sql.SQL$CursorWrapper.getRowCount(SQL.java:313)
at com.Mindspot.Mindset.mabstract._getupperlinkedspecifictypeabstracts(mabstract.java:2284)
at com.Mindspot.Mindset.dbfunctions._gettoptags(dbfunctions.java:202)
at com.Mindspot.Mindset.main._finalizelowerobjectslist(main.java:4236)
at com.Mindspot.Mindset.main._setuplowerobjectslist(main.java:6920)
at com.Mindspot.Mindset.main._createobjectsmap(main.java:1780)
at com.Mindspot.Mindset.main._activity_resume(main.java:919)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
at com.Mindspot.Mindset.main$ResumeMessage.run(main.java:273)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5146)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
There is other type of crash the may be related. it seems that somehow variables/objects that were declared and recognized stopped to be recognized.
The following is a log of timer based triggered service crash case:
** Service (eventssync) Start **
java.lang.IllegalStateException: Interval must be larger than 0.
at anywheresoftware.b4a.objects.Timer.setEnabled(Timer.java:79)
at com.Mindspot.Mindset.eventssync._service_start(eventssync.java:192)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
at com.Mindspot.Mindset.eventssync.handleStart(eventssync.java:68)
at com.Mindspot.Mindset.eventssync.onStartCommand(eventssync.java:53)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2726)
at android.app.ActivityThread.access$2100(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1302)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5146)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
at dalvik.system.NativeStart.main(Native Method)
Your help will be appreciated.
Thanks,
David.
I'm working on a project with one activity, many classes , services and SQL databases. the app suppose to constantly running in the background and the user may get the GUI by demand.
The app is running well the most of the time but I'm facing random crashes related to SQL DBs (not always in the same DB).
I validated all objects were well declared and initialized in all sequences to the crash.
Crashes occurs mostly when GUI is not visible and the App is in background for a long time. I cannot recall crashes during interactive work with the app.
There is not difference if databases are in internal or external storage.
The following is a log of a typical crash:
** Activity (main) Resume **
android.database.sqlite.SQLiteCantOpenDatabaseException: unable to open database file (code 14)
at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method)
at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:845)
at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)
at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:144)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:133)
at anywheresoftware.b4a.sql.SQL$CursorWrapper.getRowCount(SQL.java:313)
at com.Mindspot.Mindset.mabstract._getupperlinkedspecifictypeabstracts(mabstract.java:2284)
at com.Mindspot.Mindset.dbfunctions._gettoptags(dbfunctions.java:202)
at com.Mindspot.Mindset.main._finalizelowerobjectslist(main.java:4236)
at com.Mindspot.Mindset.main._setuplowerobjectslist(main.java:6920)
at com.Mindspot.Mindset.main._createobjectsmap(main.java:1780)
at com.Mindspot.Mindset.main._activity_resume(main.java:919)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
at com.Mindspot.Mindset.main$ResumeMessage.run(main.java:273)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5146)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
There is other type of crash the may be related. it seems that somehow variables/objects that were declared and recognized stopped to be recognized.
The following is a log of timer based triggered service crash case:
** Service (eventssync) Start **
java.lang.IllegalStateException: Interval must be larger than 0.
at anywheresoftware.b4a.objects.Timer.setEnabled(Timer.java:79)
at com.Mindspot.Mindset.eventssync._service_start(eventssync.java:192)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
at com.Mindspot.Mindset.eventssync.handleStart(eventssync.java:68)
at com.Mindspot.Mindset.eventssync.onStartCommand(eventssync.java:53)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2726)
at android.app.ActivityThread.access$2100(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1302)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5146)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:732)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:566)
at dalvik.system.NativeStart.main(Native Method)
Your help will be appreciated.
Thanks,
David.