question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cant Connect To SQLite

See original GitHub issue

Please 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:open
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

7reactions
augustopeterlecommented, Apr 9, 2019

SOLVED:

I put these lines in my override onCreate and the app works fine

   `StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
    StrictMode.setThreadPolicy(policy);

    Context ctx = getApplicationContext();
    Configuration.getInstance().load(ctx, PreferenceManager.getDefaultSharedPreferences(ctx));`

Thanks guys.

1reaction
ravesteijndcommented, Feb 3, 2020

Having the same problem with Android 10 and latest release of OSM. Fix posted by @augustopeterle works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't connect to a SQLite database - Stack Overflow
I am trying to do my first queries on an SQL database but I am having problems connecting to it, I think the...
Read more >
Unable to connect to SQLite database #921 - GitHub
When trying to connect to the sqlite database, I get the error 'You need to install "sqlite3@4.2.0" to connect'. Trying to install the...
Read more >
Can't connect to Sqlite DB - Get Help - Metabase Discussion
The DB is stored on a different server than metabase, when we try to get access to the DB we get this error...
Read more >
Can't connect to SQLite databases - Google Groups
Hello everyone,. I'm having a problem connecting to SQLite database files with SQLAlchemy. :memory: databases work just fine, but whenever I'm trying
Read more >
sqlite3 — DB-API 2.0 interface for SQLite databases — Python ...
SQLite is a C library that provides a lightweight disk-based database that doesn't require a separate server process and allows accessing the database...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found