Cant Connect To SQLite
See original GitHub issuePlease note: issues related to or caused by osmbonuspack will be closed with a suggestion to open an issue at https://github.com/MKergall/osmbonuspack
(feel free to delete whatever doesn’t apply)
Issue Type
[ ] Question [x ] Bug [ ] Improvement [ ] Build system related [ ] Performance [ ] Documentation
Description and/or steps/code to reproduce the problem
I tried to run an application that receives information from an external GPS and set marks on the OSM map. But now I am receiving an Error information.
W/SQLiteLog: (28) failed to open "/storage/emulated/0/osmdroid/tiles/cache.db" with flag (131138) and mode_t (0) due to error (13) (28) failed to open "/storage/emulated/0/osmdroid/tiles/cache.db" with flag (131072) and mode_t (0) due to error (13) E/SQLiteLog: (14) cannot open file at line 36356 of [605907e73a] (14) os_unix.c:36356: (13) open(/storage/emulated/0/osmdroid/tiles/cache.db) - (1) Process e.valeserialmap : Pid (4146) Uid (10247) Euid (10247) Gid (10247) Egid (10247) (1) Stat of /storage/emulated/0/osmdroid/tiles/cache.db : st_mode (100660) st_uid (0) st_gid (1015) st_ino(436002) E/SQLiteLog: (1) Stat of /storage/emulated/0/osmdroid/tiles : st_mode(40771) st_uid(0) st_gid(1015) st_ino(384387) (1) Stat of /storage/emulated/0/osmdroid : st_mode(40771) st_uid(0) st_gid(1015) st_ino(384380) (1) Stat of /storage/emulated/0 : st_mode(40771) st_uid(0) st_gid(1015) st_ino(332001) (1) Stat of /storage/emulated : st_mode(40711) st_uid(0) st_gid(1015) st_ino(336001) (1) Stat of /storage : st_mode(40755) st_uid(0) st_gid(0) st_ino(10886) E/SQLiteDatabase: Failed to open database '/storage/emulated/0/osmdroid/tiles/cache.db'. android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 1806): Could not open database ################################################################# Error Code : 1806 (SQLITE_CANTOPEN_EACCES) Caused By : Application has no permission to open the specified database file. (unknown error (code 1806): Could not open database) ################################################################# at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method) at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:272) at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:213) at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:701) at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:272) at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:239) at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:1276) at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:1231) at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:915) at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:932) at android.database.sqlite.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:924) at org.osmdroid.tileprovider.modules.SqlTileWriter.getDb(SqlTileWriter.java:731) at org.osmdroid.tileprovider.modules.SqlTileWriter.getTileCursor(SqlTileWriter.java:589) at org.osmdroid.tileprovider.modules.SqlTileWriter.loadTile(SqlTileWriter.java:610) at org.osmdroid.tileprovider.modules.MapTileSqlCacheProvider$TileLoader.loadTile(MapTileSqlCacheProvider.java:163) at org.osmdroid.tileprovider.modules.MapTileApproximater.approximateTileFromLowerZoom(MapTileApproximater.java:183) at org.osmdroid.tileprovider.modules.MapTileApproximater.approximateTileFromLowerZoom(MapTileApproximater.java:149) at org.osmdroid.tileprovider.modules.MapTileApproximater.approximateTileFromLowerZoom(MapTileApproximater.java:131) at org.osmdroid.tileprovider.modules.MapTileApproximater$TileLoader.loadTile(MapTileApproximater.java:112) at org.osmdroid.tileprovider.modules.MapTileModuleProviderBase$TileLoader.run(MapTileModuleProviderBase.java:312) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)
I don’t know why this error occurs. I’m using Android 8.1. Does anybody can help me ?
Environment
If it’s a bug, version(s) of android this affects:
Version of osmdroid the issue relates to:
6.5.3 (Latest version)
Issue Analytics
- State:
- Created 4 years ago
- Comments:9
SOLVED:
I put these lines in my override onCreate and the app works fine
Thanks guys.
Having the same problem with Android 10 and latest release of OSM. Fix posted by @augustopeterle works.