Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

The Database Inspector is empty or the database is greyed out

ErrorDatabases pane in App Inspection is empty

Short answer

The Database Inspector only reads databases that a running app has open through the SQLite library built into Android 8.0 (API 26) or higher. Check the device API level, pick the right app process in App Inspection, turn on Keep database connections open, and see whether the app bundles its own SQLite library.

  • Applies to Android Studio current stable, Android 8.0 (API 26) and higher
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check the API level of the device or emulator that runs your app. The inspector needs API 26 or higher.

    adb shell getprop ro.build.version.sdk
  2. 2Match what you see, then jump to its fix

    1. 1The first-step command prints a number lower than 26.The device runs below API 26Fix
    2. 2The app depends on an extra SQLite build (for example an encrypted-database or alternative SQLite artifact) and the pane stays empty.The app uses a SQLite library it bundles itselfFix
    3. 3The database is listed with the closed icon, or it appears only for a moment.The app closes its database connection right after using itFix
    4. 4The pane is empty although the app is running on a supported device.The wrong tab or app process is selectedFix

What does the error look like?

  • Databases pane in App Inspection is empty
  • Database shown with the closed icon
  • Android Studio database inspector does not show any databases

Cause 1 of 4

The device runs below API 26

1Check

The Database Inspector is documented to work only on API level 26 and higher.

adb shell getprop ro.build.version.sdk

2Fix

Run the app on an emulator or device with API level 26 or higher.

emulator -list-avds

3Verify

The command prints 26 or more, and the app's databases appear in the Databases pane after you select its process.

adb shell getprop ro.build.version.sdk

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 4

The app uses a SQLite library it bundles itself

1Check

The inspector works with the SQLite library in the Android operating system and does not work with SQLite libraries bundled in the app. Look at the app's dependencies.

./gradlew :app:dependencies --configuration debugRuntimeClasspath | grep -i sqlite

2Fix

Inspect a debug build that uses the platform SQLite instead of the bundled one.

# Use the platform android.database.sqlite classes (or Room on top of them) in the debug build

3Verify

With the platform SQLite in the debug build, the database appears in the Databases pane.

# Expand the database node in the Databases pane

Confirmed by developer.android.com

Did this fix it?

Cause 3 of 4

The app closes its database connection right after using it

1Check

The inspector can modify a database only while the app keeps a live connection to it. Apps that open and close the database often are hard to inspect.

# In the Databases pane, look at the icon next to the database: open or closed

2Fix

At the top of the Databases pane, switch Keep database connections open from off to on, then run the screen that opens the database.

# Android Studio: App Inspection > Database Inspector > Keep database connections open

3Verify

The database stays listed as open while you use the app.

# Expand the database node in the Databases pane

Confirmed by developer.android.com

Did this fix it?

Cause 4 of 4

The wrong tab or app process is selected

1Check

The databases of the running app appear after you open View > Tool Windows > App Inspection, choose the Database Inspector tab and select the app process from the menu.

adb shell ps | grep com.example.app

2Fix

Run the app, open App Inspection, pick the Database Inspector tab, and select your app's process in the process menu.

# Android Studio: View > Tool Windows > App Inspection > Database Inspector

3Verify

Expand the database node in the Databases pane and open a table.

# Expand the database node in the Databases pane and open a table

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Use an emulator image at API 26 or higher for database debugging.
  • Keep the platform SQLite or Room in debug builds, even if release builds use another library.
  • Turn on Keep database connections open before reproducing a bug that needs a live connection.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

4 causes, each with a fix

Mobile apps

adb tcpip 5555 fails because no device is found

adb: more than one device/emulator

adb tcpip only works while the device is attached and listed by adb, because it tells the phone to start listening on port 5555.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.