The Database Inspector is empty or the database is greyed out
Databases pane in App Inspection is emptyShort 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.
Fix it fast
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.sdk2Match what you see, then jump to its fix
- 1
The first-step command prints a number lower than 26.The device runs below API 26Fix - 2
The 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
The 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
The pane is empty although the app is running on a supported device.The wrong tab or app process is selectedFix
- 1
What does the error look like?
Databases pane in App Inspection is emptyDatabase shown with the closed iconAndroid 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.sdk2Fix
Run the app on an emulator or device with API level 26 or higher.
emulator -list-avds3Verify
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.sdkConfirmed by developer.android.com
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 sqlite2Fix
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 build3Verify
With the platform SQLite in the debug build, the database appears in the Databases pane.
# Expand the database node in the Databases paneConfirmed by developer.android.com
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 closed2Fix
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 open3Verify
The database stays listed as open while you use the app.
# Expand the database node in the Databases paneConfirmed by developer.android.com
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.app2Fix
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 Inspector3Verify
Expand the database node in the Databases pane and open a table.
# Expand the database node in the Databases pane and open a tableConfirmed by developer.android.com
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
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
The phone shows as unauthorized and Android Studio will not run the app
adb devices lists the phone but Android Studio cannot deploy to it
An unauthorized phone means it has not trusted this computer's RSA key.
3 causes, each with a fixMobile 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 fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fixMobile apps
adb prints 'server version doesn't match this client; killing...'
adb server version doesn't match this client; killing...
adb runs a background server, and every adb command is a client.
3 causes, each with a fixMobile 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