0

Actually I am storing GCM notifications in local DB on GCM notification receiver, but I am getting an error when bulk notification come.

Non-fatal Exception: android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
       at android.database.sqlite.SQLiteConnection.nativeOpen(SQLiteConnection.java)
       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:804)
       at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
       at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
       at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:994)
       at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:256)
       at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:224)
       at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
       at com.minditsystems.app1.model.GCMNotificationDB.setContext(GCMNotificationDB.java:33)
       at com.minditsystems.app1.model.GCMNotificationDB.<init>(GCMNotificationDB.java:27)
       at com.minditsystems.app1.Recievers.GCMNotificationIntentService.onHandleIntent(GCMNotificationIntentService.java:83)
       at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:136)
       at android.os.HandlerThread.run(HandlerThread.java:61)
2
  • and your AndroidManifest.xml as well Commented Feb 3, 2016 at 14:08
  • Theoretically speaking when you store multiple data, the database is currently accessed by other thread. I will suggest to use bitbucket.org/qbusict/cupboard if you are not very familiar with database access. Its a simple android database lib which can be easily implemented and used. Commented Feb 3, 2016 at 14:20

1 Answer 1

1

Possible duplicate of android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database or android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database trouble or SQLite Android cannot open database file

however... more info is needed for a concrete solution. Chcek your manifest for WRITE_EXTERNAL_STORAGE permission.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.