flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 318 forks source link

AS 4.1 Database inspector cannot find database #6964

Open talamaska opened 4 years ago

talamaska commented 4 years ago

Following these instructions https://developer.android.com/studio/inspect/database I launched the Database inspector. This is what I get - No debuggable process detected My simulator is with api 29, as seen on the screenshot and I for sure have an sqlite in my app and I use it extensively and my app is currently running.

image

I have latest AS plugins for dart and flutter. Here is my flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.22.2, on Microsoft Windows [Version 10.0.19041.572], locale bg-BG)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[!] Android Studio (version 4.1.0)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code, 64-bit edition (version 1.51.0)
[√] Connected device (1 available)

! Doctor found issues in 1 category.

Would be really nice if something an be done to make it work for flutter apps

Update: Running the android itself from AS. Now my app shows as a process to attach, but I still don't see any database

image

Maybe that should be directed to sqflite? I'm fine with removing this issue if this is not the right place.

mpgamelas commented 3 years ago

Also experiencing the same issue, would like to see if there are other people in the same situation.

enzodanjour commented 3 years ago

I have other problem, i can't find the database inspector screen in a flutter project.

mpgamelas commented 3 years ago

I have other problem, i can't find the database inspector screen in a flutter project.

You can find it on the menu View -> Tool Windows -> Database Explorer

ankushmishra2903-official commented 3 years ago

I have other problem, i can't find the database inspector screen in a flutter project.

You can find it on the menu View -> Tool Windows -> Database Explorer

It does not show on me??? Screenshot (3)

mpgamelas commented 3 years ago

Maybe your Android Studio needs to be updated?

This is more of a AS issue, not a Flutter one.

rh-id commented 3 years ago

Same issue for me. my android native project can view it but my flutter project cannot

If anyone encounter the same issue you can try to open your "MainActivity" class and click "Open for Editing in Android Studio" and choose "New Window" to open the class in separate window. the database inspector work in that opened window but you will need to run your flutter project from the flutter project window.

talamaska commented 3 years ago

@mpgamelas is it? Flutter plugin should make sure AS recognizes the android app and provide a way to use the android dev tools work with a flutter app.

KirillKarmazin commented 3 years ago

Database Inspector does not work for Flutter projects in Android Studio. Sadly.

michalorestes commented 3 years ago

Is there any chance any sort of database inspector will be added? It seems that at the moment the only solutions to view the DB are to either manually copy the database file and open it in a on a local computer (which is time consuming as you'd need to do it multiple times) or to add multiple print statements in build function (again, time consuming and this code could slip to production).

There is also a flutter package that uses chrome dev tools to show the database but it doesn't work with latest version of flutter.

erlangparasu commented 1 year ago

vscode: in flutter project, right click on android folder, then click Open in Android Studio, on android studio toolbar, click View -> Tool Windows -> App Inspection, then select tab Database Inspector.