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.

Crash: android.database.sqlite.SQLiteCantOpenDatabaseException:

See original GitHub issue

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk google group.
  • For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 3.6.1
  • Firebase Component: i have problem in /transport directory
  • Components versions: firebaseCloudMessaging 20.1.0 firebaseStorage 16.0.1 firebaseConfig 16.1.0 firebasePerfomance :19.0.5

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

I have crashes SQLite for Android version >= 7 I do have <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> in AndroidManifest.xml. Does it write to external storage or it uses internal storage?

Relevant Code:

android.database.sqlite.SQLiteCantOpenDatabaseException: 
  at android.database.sqlite.SQLiteConnection.nativeOpen (SQLiteConnection.java)
  at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:284)
  at android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:215)
  at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked (SQLiteConnectionPool.java:705)
  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:1292)
  at android.database.sqlite.SQLiteDatabase.open (SQLiteDatabase.java:1247)
  at android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:903)
  at android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:893)
  at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked (SQLiteOpenHelper.java:355)
  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:298)
  at com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore$$Lambda$1.produce (SQLiteEventStore.java:2)
  at com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore.retryIfDbLocked (SQLiteEventStore.java:456)
  at com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore.getDb (SQLiteEventStore.java:80)
  at com.google.android.datatransport.runtime.scheduling.persistence.SQLiteEventStore.runCriticalSection (SQLiteEventStore.java:488)
  at com.google.android.datatransport.runtime.scheduling.jobscheduling.WorkInitializer.lambda$ensureContextsScheduled$1 (WorkInitializer.java:54)
  at com.google.android.datatransport.runtime.scheduling.jobscheduling.WorkInitializer$$Lambda$1.run (WorkInitializer.java:2)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:764)
  at com.android.internal.os.Device.fp (Device.java)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
vkryachkocommented, Apr 20, 2020

I understand that I read it before the console is bugged that is why I enable crashlytics.

Also there is others android 8.0 devices affected not just PH7M_EU_5596, is a 8.0 issue, this is probably a bad implementation of selinux, maybe those device have a earlier version of 8.0 that has a unfinished sepolicy rulles that is prevent the write of a particularly action, I already see issues like this on other devices, maybe is something else on the underline of android permission. As this device is probably deprecated it will not receive Android updates, this issue will not be fixed by the manufacturer so if is something that we can address here will probably help others.

The change I made above will help mitigate the problem, i.e. it will not crash the app(to be released in the coming weeks), but I imagine any app or sdk that uses sqlite will not work on such devices, which is a big deal imo.

The main problem I have is that enabling the plugin has no result.

This is because the new crashlytics(com.google.firebase:firebase-crashlytics) depends on datatransport for crash delivery, and datatransport is what is failing to initialize.

To debug this further, one thing you could try doing is:

  1. Configure the old crashlytics sdk com.crashlytics.sdk.android:crashlytics:2.10.1
  2. Add the following dependency to your app com.google.firebase:firebase-datatransport:17.0.3
  3. At app start call TransportRuntime.initialize(getApplicationContext());

this will make sure the crash is delivered to Firebase Console and should preserve all the details of the stacktrace.

As I wrote… after enabling I have 75+ crashes on play console on that particularly version of the app that has crashlytics enable, and only 2 on firebase, it makes no sense to keep a thing that crashes and has no result enabled…

So lets see the result after I disable it.

Maybe someday google goes back and fixes they crash console and we can have a proper log.

The main reason I’m writing here is not to complain is just to post my info and keep my self on the conversation in case there is news on it.

No worries, thanks for your input.

2reactions
ReCursiacommented, Apr 10, 2020

I’m using this Firebase SDK library in my Android application.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash SQLiteCantOpenDatabaseException from androidx.work
I don't know how to reproduce the issue, but I have too many crashes in Google Play Vitals. Happens on many various devices....
Read more >
unknown error (code 14): Could not open database
In which I kept on getting the same DB error. android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database 06-10 23 ...
Read more >
Getting error android.database.sqlite ...
Hello. I have implemented Firebase into an application of mine and released it on Google Play. I have checked the logs and noticed...
Read more >
SQLiteCantOpenDatabaseExcep...
There are ~10-20 of these crashes in our app per day. ... SQLiteCantOpenDatabaseException: at android.database.sqlite.SQLiteConnection.
Read more >
CrashScope report
SQLiteCantOpenDatabaseException : unknown error (code 14): Could not open database E/SQLiteDatabase(26252): at android.database.sqlite.SQLiteConnection.
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