I have a full fledged app ...I renamed its package name ... and tried to run but after displaying the first page it get crashed..
here is my logcat:
815-2815/com.Bubbles E/SQLiteLog﹕ (1) no such table: centers
08-06 14:12:22.164 2815-2815/com.Bubbles D/AndroidRuntime﹕ Shutting down VM
08-06 14:12:22.165 2815-2815/com.Bubbles E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.Bubbles, PID: 2815
android.database.sqlite.SQLiteException: no such table: centers (code 1): , while compiling: SELECT * FROM centers where centername='Delhi'
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.Bubbles.database.DataBaseHelper.getCityCode(DataBaseHelper.java:413)
at com.Bubbles.Login.GetCityCode(Login.java:233)
at com.Bubbles.Login.Insertvalues(Login.java:175)
at com.Bubbles.Login.access$400(Login.java:26)
at com.Bubbles.Login$3.onClick(Login.java:144)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
waiting for a help..thanks in advance
You did more things than package rename as the real cause is:
android.database.sqlite.SQLiteException: no such table: centers
Related
I am trying to create a virtual table using fts4 with external content table. The app works fine on API 23 but when I ran it on API 16 it crashed.
Create statement :
String DDL_FTS_TODO_TABLE = "CREATE VIRTUAL TABLE "+TBL_VIRTUAL_TODO+" USING fts4(content=\""+TBL_TODO+"\", "+
COL_TODO_TITLE +", "+COL_TODO_TITLE +", "+COL_TODO_DUE_DATE+"," +COL_TODO_ALARMDATE+","+ COL_TODO_REPEAT+", "+COL_TODO_LIST_ID+")";
My logcat :
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to resume activity {com.example.recyclerviewtest/com.example.recyclerviewtest.HomeActivity}:
android.database.sqlite.SQLiteException: vtable constructor failed: virtual_todo (code 1)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2596)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2624)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2101)
at android.app.ActivityThread.access$600(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1207)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:4787)
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:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: vtable constructor failed: virtual_todo (code 1)
at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:738)
at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1675)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1602)
at com.example.recyclerviewtest.database.TodoOpenHelper.onCreate(TodoOpenHelper.java:32)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)
at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:188)
at com.example.recyclerviewtest.database.TodoContentProvider.query(TodoContentProvider.java:52)
at android.content.ContentProvider.query(ContentProvider.java:652)
at android.content.ContentProvider$Transport.query(ContentProvider.java:189)
at android.content.ContentResolver.query(ContentResolver.java:370)
at android.content.ContentResolver.query(ContentResolver.java:313)
at com.example.recyclerviewtest.database.TodoDbHelper.getAllLists(TodoDbHelper.java:123)
at com.example.recyclerviewtest.HomeActivity.onResume(HomeActivity.java:110)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1184)
at android.app.Activity.performResume(Activity.java:5082)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2586)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2624)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2101)
at android.app.ActivityThread.access$600(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1207)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:4787)
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:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)
I have changed package name of the project but when I tried to rum it shows the message "Unfortunately App has stopped".I had followed the following steps to change my package name Android Studio Rename Package
My logcat error is as follows:
08-04 18:08:54.806 27626-27626/com.Bubbles E/SQLiteLog﹕ (14) cannot open file at line 30046 of [9491ba7d73]
08-04 18:08:54.806 27626-27626/com.Bubbles E/SQLiteLog﹕ (14) os_unix.c:30046: (2) open(/data/data/com.confec/databases/confec.sqlite) -
08-04 18:08:54.807 27626-27626/com.Bubbles E/SQLiteDatabase﹕ Failed to open database '/data/data/com.confec/databases/confec.sqlite'.
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:806)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:791)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:669)
at com.Bubbles.database.DataBaseHelper.checkDataBase(DataBaseHelper.java:95)
at com.Bubbles.database.DataBaseHelper.createDataBase(DataBaseHelper.java:58)
at com.Bubbles.MainActivity.onCreate(MainActivity.java:93)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
08-04 18:08:54.809 27626-27626/com.Bubbles D/AndroidRuntime﹕ Shutting down VM
08-04 18:08:54.809 27626-27626/com.Bubbles E/AndroidRuntime﹕ FATAL EXCEPTION: main
I appreciate any help and thanks in advance. :)
I'm working on an app written three years ago in Eclipse for Android Devices. After downloading Android Studio, I decided to test the app using the default testing device Nexus_5_API_22_x86 [emulator-5554].
As I test the app, I get to the last step where the final question in the questionnaire is answered, the button label is replaced with the text "Finish". However, I get the below error from Android Studio when the application crashes.
I'm not an android developer (I'm actually a Web Application Developer using PHP, MySQL, JS / jQuery so on...) but I do have some experience with Java (Albeit not a lot, but I'll get there) My understanding of the error has lead me to three functions which I have followed and they seem to be ok.
FYI: I was not the developer who wrote this app.
Can anyone suggest what I should be looking for ?
07-04 14:48:28.331 15408-15408/au.com.psychic.psychictest E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: au.com.psychic.psychictest, PID: 15408
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:4020)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at android.view.View$1.onClick(View.java:4015)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
at au.com.psychic.psychictest.Questions.GetResult(Questions.java:110)
at au.com.psychic.psychictest.MainActivity.setQuestion(MainActivity.java:68)
at au.com.psychic.psychictest.MainActivity.nextQuestion(MainActivity.java:90)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at android.view.View$1.onClick(View.java:4015)
at android.view.View.performClick(View.java:4780)
at android.view.View$PerformClick.run(View.java:19866)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
It clearly states ArrayIndexOutOfBoundsException. Your program is trying to access some array's 4th element when the size of array is 3. You should have a look at the line numbers specified in the error, in the respective files.
>
at au.com.psychic.psychictest.Questions.GetResult(Questions.java:110)
at au.com.psychic.psychictest.MainActivity.setQuestion(MainActivity.java:68)
at au.com.psychic.psychictest.MainActivity.nextQuestion(MainActivity.java:90)
Also, you can try debugging your code, that can help.
After I Change package name there is an error occur like.
I am tryng to change package name. package name will be change but there is an error that service not register. and my application cant able to run properly. application cant able to destroy launcher activity.
06-26 16:45:19.806 27366-27366/my.instaupdate.otr.app.im E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: my.instaupdate.otr.app.im, PID: 27366
java.lang.RuntimeException: Unable to destroy activity {my.instaupdate.otr.app.im/my.instaupdate.otr.app.im.app.WelcomeActivity}: java.lang.IllegalArgumentException: Service not registered: my.instaupdate.cacheword.CacheWordActivityHandler#14403580
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3758)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3776)
at android.app.ActivityThread.access$1400(ActivityThread.java:148)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1346)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5312)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
Caused by: java.lang.IllegalArgumentException: Service not registered: my.instaupdate.cacheword.CacheWordActivityHandler#14403580
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1033)
at android.app.ContextImpl.unbindService(ContextImpl.java:1936)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:550)
at my.instaupdate.otr.app.im.app.WelcomeActivity.onDestroy(WelcomeActivity.java:231)
at android.app.Activity.performDestroy(Activity.java:6132)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1163)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3745)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3776)
at android.app.ActivityThread.access$1400(ActivityThread.java:148)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1346)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5312)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
this error about what???
It started on an Android phone, simple create statement in a file inside the assets/migrations folder (I use a 3rd party library called ActiveAndroid and for 2 years it worked okay - I did not changed anything about that):
CREATE TABLE IF NOT EXISTS Car (Brand TEXT);
I get this exception:
04-07 15:31:36.683 15738-15738/? E/SQLiteLog﹕ (21) API called with NULL prepared statement
04-07 15:31:36.683 15738-15738/? E/SQLiteLog﹕ (21) misuse at line 63243 of [00bb9c9ce4]
java.lang.RuntimeException: Unable to create application com.activeandroid.app.Application: android.database.sqlite.SQLiteException: not an error (code 0)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4394)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
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:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: not an error (code 0)
at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:727)
at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1665)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1594)
at com.activeandroid.DatabaseHelper.executeSqlScript(DatabaseHelper.java:185)
at com.activeandroid.DatabaseHelper.executeMigrations(DatabaseHelper.java:155)
at com.activeandroid.DatabaseHelper.onUpgrade(DatabaseHelper.java:78)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:257)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
at com.activeandroid.Cache.openDatabase(Cache.java:104)
at com.activeandroid.Cache.initialize(Cache.java:77)
at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:43)
at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:30)
at com.activeandroid.app.Application.onCreate(Application.java:25)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
So I checked it on my computer with a Firefox addon called SQLite Manager and created a brand new file (the file is totally unrelated to the Android database).
I used this select and on the last error I get this:
It seems that every SQLite statement is a not an error statement.
Unfortunately, Android can't handle that.
What should I do?
It seems that the upgrade script in the assets\migration folder had some empty lines and that caused the not an error.