Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error reading Sqlite database: Database google_app_measurement_local.db not found

Suddenly I'm getting this in the event log when launching the app Database Inspector: Error reading Sqlite database: Database 'LiveSqliteDatabaseId(path=/data/data/app-dir/databases/google_app_measurement_local.db, name=google_app_measurement_local.db, connectionId=1) not found

Upon checking the databases path, I saw there is google_app_measurement_local.db in the directory. Any idea what causing this to show up?

BTW, I'm using Android Studio 4.2 and here the versions of Firebase for this app

implementation "com.google.firebase:firebase-core:19.0.0"
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.google.firebase:firebase-analytics:19.0.0'
implementation 'com.google.firebase:firebase-crashlytics:18.0.0'
implementation "com.google.firebase:firebase-database:20.0.0"
implementation "com.google.firebase:firebase-config:21.0.0"
like image 678
Mike Avatar asked May 20 '21 09:05

Mike


1 Answers

This could happen due to many reasons, for example:

  1. Android Studio IDE (Database inspector) having a bug
  2. Build cache is corrupted
  3. the libraries that you are using from google might be having conflicting versions
    ======================================================

Android Studio IDE (Database inspector) having a bug

Not really much you can do in this case as the right fix, but as a workaround, you can disable your database inspector. As you have mentioned that you are using Android studio 4.2 and this version has the capability for user to disable database inspector.

Android Studio 4.2.0+

Database Inspector -> (device list dropdown in top-left corner) -> Stop Inspector

Below 4.2.0

File -> Invalidate Caches/Restart -> Just Restart (no need to invalidate caches)

Build cache is corrupted

Simply invalidate caches and restart the project

File -> Invalidate Caches/Restart -> Invalidate and Restart

This should resolve the problem if its build folder is corrupted.

Firebase Libraries are conflicting

First, make sure that you have the latest version of all of them. But I must recommend using Firebase Android Bom for versioning of the firebase libraries. it automatically controls which versions should be picked for each library that you have included in your app Gralde file. See example:

dependencies {
  // Import the BoM for the Firebase platform
  implementation platform('com.google.firebase:firebase-bom:28.3.0')

  // Declare the dependencies for the desired Firebase products without specifying versions
  // For example, declare the dependencies for Firebase Authentication and Cloud Firestore
  implementation 'com.google.firebase:firebase-auth'
  implementation 'com.google.firebase:firebase-firestore'
}

I hope this solves the problem for you. If IDE workaround works for you, make sure to file a bug/Issue to Google.

like image 64
Wajid Avatar answered Oct 18 '22 07:10

Wajid