2021-09-03 11:10:53.194 25440-25488/org.litepal.litepalsample E/SQLiteLog: (14) cannot open file at line 38589 of [b2325a6e1c]
2021-09-03 11:10:53.194 25440-25488/org.litepal.litepalsample E/SQLiteLog: (14) os_unix.c:38589: (2) open(/storage/emulated/0/.Sample/cache/databases/sample.db) -
2021-09-03 11:10:53.207 25440-25488/org.litepal.litepalsample E/SQLiteDatabase: Failed to open database '/storage/emulated/0/.Sample/cache/databases/sample.db'.
android.database.sqlite.SQLiteCantOpenDatabaseException: Cannot open database '/storage/emulated/0/.Sample/cache/databases/sample.db': Directory /storage/emulated/0/.Sample/cache/databases doesn't exist
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:257)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:210)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:516)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:198)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:922)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:902)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:766)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:755)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:378)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:321)
at org.litepal.tablemanager.Connector.getWritableDatabase(Connector.java:58)
at org.litepal.tablemanager.Connector.getDatabase(Connector.java:70)
at org.litepal.litepalsample.activity.SaveSampleActivity$1.run(SaveSampleActivity.java:114)
at java.lang.Thread.run(Thread.java:923)
Caused b
当我设置了存储路径 后,app报错日志如下:
2021-09-03 11:10:53.194 25440-25488/org.litepal.litepalsample E/SQLiteLog: (14) cannot open file at line 38589 of [b2325a6e1c] 2021-09-03 11:10:53.194 25440-25488/org.litepal.litepalsample E/SQLiteLog: (14) os_unix.c:38589: (2) open(/storage/emulated/0/.Sample/cache/databases/sample.db) - 2021-09-03 11:10:53.207 25440-25488/org.litepal.litepalsample E/SQLiteDatabase: Failed to open database '/storage/emulated/0/.Sample/cache/databases/sample.db'. android.database.sqlite.SQLiteCantOpenDatabaseException: Cannot open database '/storage/emulated/0/.Sample/cache/databases/sample.db': Directory /storage/emulated/0/.Sample/cache/databases doesn't exist at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:257) at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:210) at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:516) at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:206) at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:198) at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:922) at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:902) at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:766) at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:755) at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:378) at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:321) at org.litepal.tablemanager.Connector.getWritableDatabase(Connector.java:58) at org.litepal.tablemanager.Connector.getDatabase(Connector.java:70) at org.litepal.litepalsample.activity.SaveSampleActivity$1.run(SaveSampleActivity.java:114) at java.lang.Thread.run(Thread.java:923) Caused b