2

for some time an error SQLiteCantOpenDatabaseException has been thrown in my application. Adding WRITE_EXTERNAL_STORAGE permission didn't help. Also I've used ActiveAndroid ORM instead of default android sql implementation. I don't know what is the reason. This error occurs only on Huawei devices. Here are the logs:

Caused by: android.database.sqlite.SQLiteCantOpenDatabaseException: 

  at android.database.sqlite.SQLiteConnection.nativeOpen (SQLiteConnection.java)

  at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:223)

  at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:207)

  at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked (SQLiteConnectionPool.java:511)

  at android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:194)

  at android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:183)

  at android.database.sqlite.SQLiteDatabase.openInner (SQLiteDatabase.java:880)

  at android.database.sqlite.SQLiteDatabase.open (SQLiteDatabase.java:864)

  at android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:767)

  at android.app.ContextImpl.openOrCreateDatabase (ContextImpl.java:820)

  at android.content.ContextWrapper.openOrCreateDatabase (ContextWrapper.java:299)

  at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked (SQLiteOpenHelper.java:266)

  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:206)

  at com.activeandroid.Cache.openDatabase (Cache.java:5)

  at com.activeandroid.Cache.initialize (Cache.java:45)

  at com.activeandroid.ActiveAndroid.initialize (ActiveAndroid.java:3)

  at com.activeandroid.ActiveAndroid.initialize (ActiveAndroid.java:1)

  at com.activeandroid.ActiveAndroid.initialize (ActiveAndroid.java:9)

  at com.my.alarmclock.MyApplication.onCreate (MyApplication.java:3)

  at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1122)

  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6517)

  at android.app.ActivityThread.-wrap2 (Unknown Source)

  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1963)

  at android.os.Handler.dispatchMessage (Handler.java:108)

  at android.os.Looper.loop (Looper.java:166)

  at android.app.ActivityThread.main (ActivityThread.java:7425)

  at java.lang.reflect.Method.invoke (Method.java)

  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:245)

  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:921)
MikeT
  • 51,415
  • 16
  • 49
  • 68
Adrian89
  • 21
  • 1
  • 3
  • 1
    I have the same problem, only Huwei devices fail to copy the assets once. Or they don't release the file lock low level, that's my theory. It seems to work on the second run, after everything crashed. Maybe china requests "a copy for security" – CaptainCrunch Dec 09 '20 at 15:38

0 Answers0