RioBus / android-app

RioBus mobile app written with Java
http://riob.us
GNU General Public License v2.0
19 stars 20 forks source link

Fatal Exception raised when clicking in the "Search button" #78

Open fmsouza opened 8 years ago

fmsouza commented 8 years ago

It appears while opening the app for the very first time and clicking in the search button.

03-26 00:14:46.461 7694-7771/com.tormentaLabs.riobus I/OpenGLRenderer: Initialized EGL, version 1.4
03-26 00:14:50.008 7694-7694/com.tormentaLabs.riobus E/SQLiteLog: (1) no such column: NUMBER_OF_ACCESS
03-26 00:14:50.009 7694-7694/com.tormentaLabs.riobus D/AndroidRuntime: Shutting down VM
03-26 00:14:50.010 7694-7694/com.tormentaLabs.riobus E/AndroidRuntime: FATAL EXCEPTION: main
                                                                       Process: com.tormentaLabs.riobus, PID: 7694
                                                                       Theme: themes:{default=overlay:system}
                                                                       java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tormentaLabs.riobus/com.tormentaLabs.riobus.search.SearchActivity_}: android.database.sqlite.SQLiteException: no such column: NUMBER_OF_ACCESS (code 1): , while compiling: SELECT * FROM LINES ORDER BY NUMBER_OF_ACCESS DESC
                                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2450)
                                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510)
                                                                           at android.app.ActivityThread.-wrap11(ActivityThread.java)
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363)
                                                                           at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                           at android.os.Looper.loop(Looper.java:148)
                                                                           at android.app.ActivityThread.main(ActivityThread.java:5461)
                                                                           at java.lang.reflect.Method.invoke(Native Method)
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
                                                                        Caused by: android.database.sqlite.SQLiteException: no such column: NUMBER_OF_ACCESS (code 1): , while compiling: SELECT * FROM LINES ORDER BY NUMBER_OF_ACCESS DESC
                                                                           at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
                                                                           at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
                                                                           at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
                                                                           at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
                                                                           at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
                                                                           at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)
                                                                           at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:44)
                                                                           at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1316)
                                                                           at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1255)
                                                                           at com.tormentaLabs.riobus.core.controller.LineController.fetchCursor(LineController.java:55)
                                                                           at com.tormentaLabs.riobus.search.SearchActivity.afterViews(SearchActivity.java:61)
                                                                           at com.tormentaLabs.riobus.search.SearchActivity_.onViewChanged(SearchActivity_.java:90)
                                                                           at org.androidannotations.api.view.OnViewChangedNotifier.notifyViewChanged(OnViewChangedNotifier.java:41)
                                                                           at com.tormentaLabs.riobus.search.SearchActivity_.setContentView(SearchActivity_.java:55)
                                                                           at com.tormentaLabs.riobus.search.SearchActivity_.onCreate(SearchActivity_.java:44)
                                                                           at android.app.Activity.performCreate(Activity.java:6251)
                                                                           at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
                                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2403)
                                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2510) 
                                                                           at android.app.ActivityThread.-wrap11(ActivityThread.java) 
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1363) 
                                                                           at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                           at android.os.Looper.loop(Looper.java:148) 
                                                                           at android.app.ActivityThread.main(ActivityThread.java:5461) 
                                                                           at java.lang.reflect.Method.invoke(Native Method) 
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
limazix commented 8 years ago

Last week I add this column to sort the lines by numbers of access. Since the is not in production I didn't create the migration structure. You just need to uninstall the app then install again. Doing this the DB will be recreated with the new structure.

fmsouza commented 8 years ago

Ok. So I'll leave this issue here for someone to fix before releasing the app for public.

fmsouza commented 8 years ago

If I do a wipe data before open the app, it works. Maybe it's trying to create the database on Android 6.0.1 but doesn't has the permission to access the storage, so the database is not created and the whole thing explodes...