14

I am getting such notice

Error reading Sqlite database: Unable to perform an operation on database (id=3). The database may have already been closed.

when debugging my app in Android Studio emulator if I fast change process of Database Inspector then app work ok on emulator otherwise it immediately is diconnected and crashes.

Michał Ziobro
  • 10,759
  • 11
  • 88
  • 143

4 Answers4

2

I got a simple solution which doesn't use the database inspector.

Remove it from the bottom menu. If you don't click on it, then Android Studio works properly. The problem comes after you open the "Database inspector" tab.

Removal process: Right-click on Database Inspector -> Remove from Sidebar.

zcoop98
  • 2,590
  • 1
  • 18
  • 31
Anil Ugale
  • 1,143
  • 2
  • 9
  • 23
1

I always have this issue with an Android 11 Emulator.

Google known this issue and published an update for them. To solve this update your emulator Android 11 images to revision 9, and all things works fine.

Steps to solving this issue:

  1. Open Preferences -> Appearance & Behavior -> System Settings -> Android SDK
  2. Open tab SDK Platforms
  3. Enable Show Package Details (right bottom corner)
  4. Expand Android 11.0 (R)
  5. Update all ... System Image options to minimum Revision 9
  6. Restart Emulator

Now your application should work with active database inspector.

Fabi755
  • 1,495
  • 1
  • 12
  • 29
1

Please see the official solution to fix this issue: https://developer.android.com/studio/known-issues#ki-android-11-db-inspector

valerybodak
  • 4,195
  • 2
  • 42
  • 53
0

Downgrading the android studio IDE from Electric Eel to Artic Fox helped me fix the problem.

Adriaan
  • 17,741
  • 7
  • 42
  • 75
Guilejfwe
  • 398
  • 1
  • 3
  • 7