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)
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
  • and your AndroidManifest.xml as well – Shark Feb 03 '16 at 14:08
  • Theoretically speaking when you store multiple data, the database is currently accessed by other thread. I will suggest to use https://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. – Thilek Feb 03 '16 at 14:20

1 Answers1

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.

Community
  • 1
  • 1
Shark
  • 6,513
  • 3
  • 28
  • 50