wangdan / AisenWeiBo

新浪微博第三方Android客户端
1.85k stars 575 forks source link

Run后SQLite异常:无法找到这个表 #19

Open WhyMeta opened 8 years ago

WhyMeta commented 8 years ago
02-28 01:59:25.109 14226-14226/org.aisen.weibo.sina E/AndroidRuntime: FATAL EXCEPTION: main
                                                                      Process: org.aisen.weibo.sina, PID: 14226
                                                                      java.lang.RuntimeException: Unable to create application com.android.tools.fd.runtime.BootstrapApplication: android.database.sqlite.SQLiteException: no such table: org_aisen_weibo_sina_support_bean_AccountBean (code 1): , while compiling: SELECT userId, $change, account, advancedToken, cookie, groups, password, token, user FROM org_aisen_weibo_sina_support_bean_AccountBean WHERE  com_m_common_key = ?
                                                                          at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4699)
                                                                          at android.app.ActivityThread.access$1500(ActivityThread.java:174)
                                                                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1458)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:110)
                                                                          at android.os.Looper.loop(Looper.java:222)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:5484)
                                                                          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:860)
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:676)
                                                                          at dalvik.system.NativeStart.main(Native Method)
                                                                       Caused by: android.database.sqlite.SQLiteException: no such table: org_aisen_weibo_sina_support_bean_AccountBean (code 1): , while compiling: SELECT userId, $change, account, advancedToken, cookie, groups, password, token, user FROM org_aisen_weibo_sina_support_bean_AccountBean WHERE  com_m_common_key = ?
                                                                          at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
                                                                          at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:893)
                                                                          at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:504)
                                                                          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:1364)
                                                                          at android.database.sqlite.SQLiteDatabase.queryWithFactory(SQLiteDatabase.java:1211)
                                                                          at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1082)
                                                                          at android.database.sqlite.SQLiteDatabase.query(SQLiteDatabase.java:1288)
                                                                          at org.aisen.orm.SqliteUtility.select(SqliteUtility.java:117)
                                                                          at org.aisen.orm.SqliteUtility.select(SqliteUtility.java:96)
                                                                          at org.aisen.weibo.sina.support.db.AccountDB.getLogedinAccount(AccountDB.java:31)
                                                                          at org.aisen.weibo.sina.base.MyApplication.onCreate(MyApplication.java:134)
                                                                          at com.android.tools.fd.runtime.BootstrapApplication.onCreate(BootstrapApplication.java:305)
                                                                          at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
                                                                          at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4696)
                                                                          at android.app.ActivityThread.access$1500(ActivityThread.java:174) 
                                                                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1458) 
                                                                          at android.os.Handler.dispatchMessage(Handler.java:110) 
                                                                          at android.os.Looper.loop(Looper.java:222) 
                                                                          at android.app.ActivityThread.main(ActivityThread.java:5484) 
                                                                          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:860) 
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:676) 
                                                                          at dalvik.system.NativeStart.main(Native Method) 
Zhanglichun commented 8 years ago

你是怎么登录的? 我登陆不上啊

WhyMeta commented 8 years ago

@Zhanglichun 就是登陆不上,可能是作者申请的 token key 什么的过期了吧

MrXinK commented 8 years ago

@MinHuZ 这个是由于在反射AccountBean类时,多了一个$change,导致创建表失败。根本的原因是Android Studio默认启动了Instant Run功能。你可以查看这里跟进问题。