Naomath / MyApplication_app_contest

0 stars 0 forks source link

ArrayListから配列にしたら、保存でエラー発生 #11

Open Naomath opened 7 years ago

Naomath commented 7 years ago

エラー全文

08-04 11:50:48.307 11581-11581/com.lifeistech.naoto.myapplication_app_contest E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                                Process: com.lifeistech.naoto.myapplication_app_contest, PID: 11581
                                                                                                android.database.sqlite.SQLiteException: table GROUP_TWO_WORDS has no column named SIZE (code 1): , while compiling: INSERT OR REPLACE  INTO GROUP_TWO_WORDS(GROUPNAME,ID,SIZE,TWO_WORDSES) VALUES (?,?,?,?)
                                                                                                    at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
                                                                                                    at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:887)
                                                                                                    at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:498)
                                                                                                    at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
                                                                                                    at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
                                                                                                    at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
                                                                                                    at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1469)
                                                                                                    at com.orm.SugarRecord.save(SugarRecord.java:266)
                                                                                                    at com.orm.SugarRecord.save(SugarRecord.java:360)
                                                                                                    at com.lifeistech.naoto.myapplication_app_contest.SetUpActivity$6.onClick(SetUpActivity.java:194)
                                                                                                    at android.support.v7.app.AlertController$ButtonHandler.handleMessage(AlertController.java:157)
                                                                                                    at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                                    at android.os.Looper.loop(Looper.java:148)
                                                                                                    at android.app.ActivityThread.main(ActivityThread.java:5417)
                                                                                                    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)
halu5071 commented 7 years ago

これはGithubにpushしてくれたかな?? たぶんデータベースに保存する際に、今まであったデータと追加したデータでConflictしてるね。

アプリを一度アンインストールしてから実行してみたらどう??