Setting up DevTools failed (Flutter Inspector) - android-studio

I could not find solution to this either on google or here on StackOverflow. There is only and only 1 question answered related to this issue [https://stackoverflow.com/questions/64655867/about-android-studio-and-flutter-inspector], however for a beginner like me, its not clear about what exactly to do.
Additional information:
OS: Windows
Android studio version 4.1.1
App is running in avd when I opened flutter inspector panel.
Stopped and run the app again.
Previously, somewhere I read that if inspector is not showing anything, click on any widget pressing ctrl key. That worked previously, but not working now. Sure, that was different error and different situation.
flutter doctor screenshot also attached
flutter inspector screenshot
flutter doctor screenshot

This answer from related question helped.
...
And the third one (the one that worked for me): go to File >
Settings > Languages & Frameworks > Flutter > Experiments … and there
you should uncheck “Enable embedding DevTools in the Flutter Inspector
tool window”. That should allow you to use devtools locally instead of
the embedded ones.
picture for reference
Source: https://stackoverflow.com/a/65542661/17789382

Launch Flutter DevTools from terminal using command dart devtools which opens DevTools in the browser. Connect to the address in which debug/run service listening on. Address can be found in the console when the app starts running. Ex: ws://127.0.0.1:54851/JF3H6rhQnN0=/ws.

The following steps helped me to get Flutter Inspector Widget Tree back, hopefully, it will help you as well:
File -> Settings -> Languages & Frameworks -> Flutter:
Enable (Check) "Open Flutter Inspector view on app launch"
Stop and start the app again.
Note: In order for something to show up in the Flutter Inspector, your app has to be running on a Device or on a Simulator or Emulator.

Related

Flutter Inspector and Widget Tree not loading in Android Studio

I have installed latest version of Android Studio as well as all the necessary plugins such as Dart and Flutter. When I run an application and hit the Flutter Inspector tab on the right side of the screen, the Flutter Inspector window pops up with a message saying "The JxBrowser license could not be found".
I have tried all the workarounds indicated in this thread but were to no avail.
Is there anything I missed about the JxBrowser or something?
I've experienced the same message. But I think I've found a temporal way to use the inspector on Android Studio without Layout Explorer (Visualization part for widgets) before Flutter team fixing it.
Go to Preferences > Languages & Frameworks > Flutter and uncheck Enable embedding DevTools in the Flutter Inspector tool window
Then you can use it without Layout Explorer inside Android Studio.
But, if you have to use such a Layout Explorer, then you can use the DevTools in the browser.

Android Studio and Capacitor cannot finde console.log() output

I have a Angular Application that i converted via Capacitor to a Android App. If i start my app in Android Studio i cannot access my Nodejs. Therefor i want to use the console.log() to see where my problem is.
But i cant find an output of my log, even though its there in the web console.
You can see Capacitor logs in two different places.
Chrome remote inspector, just type this in your Desktop Chrome chrome://inspect/#devices and your device should appear there and a list of webs and apps that can be debugged, choose your app and you'll see all the console.logs there.
Logcat. Inside Android Studio on the bottom on the screen there should be a Logcat section, if you click it it should show console.log messages and also native messages.

"Unable to locate adb" using Android Studio on Windows 10 to develop Flutter apps

Android Studio upgraded to version 4.0.1, and now I get a "Unable to locate adb" message when trying to launch an Android emulator image from the AVD manager, in order to run/debug a Flutter app. I have tried all the obvious things, e.g. checked to see that there is an adb.exe image at .../AppDate/Local/Android/Sdk/platform-tools. I have even tried de-installing completely and did a clean install of everything from scratch. I have plenty of disk space, anti-virus has not quarantined it. Interesting, if I start a native Android app (e.g. "basic activity"), then the message goes away and the image starts OK
Android Studio - launch emulator AVD - "unable to locate adb"
Visit the above link to get solution in detailed way with pictures.
I had the same issue as you were facing, I have Researched the Whole Internet but found nothing useful. So, I somehow figured out the problem and fixed it, The problem is at
app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Whenever we create a new project due to some reason the Module SDK is not set up automatically. Thus the ADB manager was throwing an error 'Unable to locate AVD', which is not that fatal as the error/warning is not stopping us from launching /starting the emulator, but it is so annoying to see that pop-up box. So here is my simple and quick fix.
Solution:
Click on the project folder, tap the dropdown icon just beside it.
Now Navigate to the path below.
android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Now Click on the file GeneratedPluginRegistrant.java to open it.
Once it is open, At the Top you will notice a bar that says 'Module SDK is not defined',
Now right against it, you will also see a hyper-text named 'Setup SDK', Just Click on it.
That will open a Pop-up Box with the title 'Select project SDK'.
Now select the Android Platform API and then click OK. After that being done Restart your IDE.
Your Problem will be Solved. And you will also notice that Emulator Opens up way faster than before.
NOTE:
The Above Steps has to be performed with every new flutter project.
I have already answered to your question before to Read more and understand in detail with pictures just visit the link
Android Studio - launch emulator AVD - "unable to locate adb"

How to change app icons & UI in flutter using flutter Inspector?

I brought an app source code from (CodeCanyon) and i want to change the side navigation drawer icon from the given one to the default hamburger icon or something.
They have given me the docs of Flutter page to change it using Flutter Inspector but i don't know how to do it.
Here is the link they send me...
https://flutter.dev/docs/development/tools/devtools/inspector
Help me out...
From Android Studio, run the application in an Emulator or real device.
In the debug tab of Android Studio the 'Open DevTools' button (its icon is the Dart logo) next to the Hot Reload and Hot Restart buttons. This will launch a Dart DevTools tab.
After the new browser tab opens, click the "Try DevTools beta" button in the top right of the screen. This will take you to a new beta version of DevTools.
From there you will see what the linked page is talking about, but you must be on the latest version of Flutter.
On 25th june flutter has declared the stable dev tool, in that if you want to change in ui then,you just have to open dev tool with your connected device and in Flutter inspector enable the select widget mode. and in layout explorer you can changes the ui design properties. But remember one thing you can only changes in the row, column and container properties.

Capacitor compiled Ionic app: How to debug in Android Studio?

I used the command
ngx cap open android
to open my Ionic 5 project in Android Studio like described here. This works fine.
In my app, i`m connecting to server which returns json data needed by my app. This connection does not seem to work, I only have the loading animation in my app.
How can I debug this? It is working in the PWA version and on my Ionic testserver, but the app has a problem connecting. I need an error message or something, to know what goes wrong.
What is a good way to fix such problems? Can I output or log something in android studio from the typescript code?
Open the Chrome browser and navigate to the URL chrome://inspect/#devices. Your connected Android device should show up in the list of Remote Targets.
On your device, open the Ionic app that you would like to debug using Chrome.
With your app running on the device, head back to Chrome and click on inspect chrome://inspect/#devices
see more:
Capacitor compiled Ionic app: How to debug in Android Studio?
I have posted a full project here specifically for use with Angular and Capacitor.
I believe the trick is that you have to use live-reload to debug. If you used the ionic cli to build your project then you should be good to go using the basic commands provided, otherwise you will need to so some modifications manually. This project, post breaks it all down
https://github.com/aaronksaunders/plain-ng-cap-app
Capacitor Run, see section on liveReload - https://ionicframework.com/docs/cli/commands/capacitor-run

Resources