firebase-android-sdk: Crash: android.database.sqlite.SQLiteCantOpenDatabaseException:

[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)

About this issue

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

Commits related to this issue

Most upvoted comments

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.

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

@vkryachko, @ashwinraghav, hello, i updated all Firebase dependencies to actual versions (May 21), but they use firebase-datatransport:17.0.3. Specifically, com.google.firebase:firebase-messaging:20.2.0 uses old version of datatransport library. How to use the newest version of datatransport correctly (update firebase libraries or something)? Because now i have to force override version in Gradle to use the newest one.

@ReCursia it will be included in the next Firebase release sometime late next week under version firebase-datatransport:17.0.5.