Flutter VSCode, unable to android module in Android Studio - android-studio

Hi I am trying to open Flutter android module in android studio by right clicking android folder and then " Open in Android Studio " but its doing nothing.
I have correctly setup android-studio-dir but still unable to open. I am using Ubuntu 19.04.

This is a bug. I've opened https://github.com/Dart-Code/Dart-Code/issues/1897 to look at this. We previously tweaked this code to look for studio.sh instead of studio but now I'm wondering if that's not consistent. I'll change it to look for both.

Related

Flutter error on updating Android Studio, Kotlin, Flutter, Dart plugins are incompatible with the new Android Studio version 4.0

I just updated the Android Studio to 4.0, and now I am getting the errors in my IDE that Kotlin, Flutter, Dart plugins are incompatible with the new Android Studio version 4.0, what's the solution?
Press cmd + , to open Settings.
Look for Plugins in the tab bar.
You will see an option to update them and restart IDE, (I already did that, so it's not showing that option).
After updating, click on File > Invalidate Caches / Restart .... in Android Studio toolbar.
Run
flutter clean
How i fixed this:
Locate and open the idea.properties file in your Android/bin folder
Add idea.plugins.host=https://plugins.jetbrains.com to the file.
Save and close file
Relaunch Android Studio

Android Studio not showing Chrome as Flutter device

I got a small problem which accured after reinstalling Android Studio:
Android Studio
Android Studio is not showing Chrome as Device for my Flutter Web project, while flutter doctor shows clearly everything is enabled correctly:
Flutter doctor
I can normally run the flutter project on google chrome using the console or VS Code, but Android Studio does not work. I already checked the Flutter and Dart plugin.
I would be glad if someone who maybe had the same issue or knows how to fix this gets back to me!
Best Regards
Clearly it is not the issue with flutter. It is an issue with your Android Studio installation. You can verify the same by navigating to the your project folder in the terminal (or command prompt) and type
flutter run -d Chrome.
NOTE: The above command works only if you are on master, beta or dev branch and you have already enabled your flutter web support by typing
flutter config --enable-web
I noticed that your path to Android Studio as: C:\Program Files\Android\ Android Studio1
It means that during installation the original Android Studio folder is not deleted. A duplicate folder has been created in the same location. Hence the Android sdk location is must be changed as well.
You can solve this by:
Uninstall Android Studio. Delete the folder at the above location. Reinstall Android Studio. Update sdk path in your sdk manager as well as in your environment variable. (recommended).
Update the sdk folder in the sdk manager as well as your environment variables.

Problems with setting up Android Studio with Flutter on Mac

I made my project on Windows computer, now I'm trying to export to ios on friend's Mac. I've been following this tutorial from part 1 all the way to part 5. How to Install and Setup Flutter for App Development on Mac - Part 1. In other words, Xcode is installed, Android Studio with Flutter and dart plugin installed as well. Android Studio recognizes both simulator and plugged iPhone. When I open the project in Android Studio it looks like this:
Note: Both flutter folder and the project folder are located in "exportalex"
Please try to use terminal and hit this: flutter pub get
You need to load all the dependency before run app.
If still you are facing same issue, please run: flutter doctor
Then share screenshot of result.

I can't build or run my flutter app from android studio but it works from the command line

I'm building a flutter app on a mac for the first time. Android studio doesn't provide me any way to build or run the app. The green triangle run button is greyed out, and it doesn't have a spot for me to select my emulator.
If I open an emulator and run the app from the command line it builds and runs just fine. The only issue is that android studio doesn't give me the option to run it at all.
Here's what my android studio looks like
And here's flutter doctor
I'd prefer to not switch environments and to continue being able to develop with android studio, instead of switching to xcode or VScode.
Thanks for any and all help!
The green triangle run button is greyed out for me too in Android Studio but the project can be run from command line using "flutter run".
To enable the run button in Android Studio, go to Settings->Languages & Frameworks->Dart:
Enable Dart support for the project (checkbox)
Set the Dart SDK path (on my machine it was "C:\flutter\bin\cache\dart-sdk")
Select the modules to enable Dart support
Screenshot of Android Studio Dart settings
Open pubspec.yaml in your IDE and click on packages get option
This should fix your problem.

Flutter build.gradle trouble

I am currently starting Flutter Blue, a Bluetooth plugin for Flutter. I imported the example -> android -> app folder into Android studio.
However, when I am trying to build and run the code, I get the error: "Flutter SDK not found. Define location with flutter.sdk in the local.properties file. "
I googled around for a solution and added the flutter SDK path into the local.properties file but that hasn't remedied the issue yet.
flutter.sdk=/Users/me/Applications/flutter
I suspect that I am just not using Android Studio or importing the files/code correctly. I am able to compile and run Flutter's default demo app (click-counter) without any issues, so I'm fairly certain Flutter & Android Studio was installed and set up correctly.
My intuition was that the build.gradle could be directly run akin to an APK by Android Studio's device emulator. Any suggestions?
Thanks! https://github.com/pauldemarco/flutter_blue/tree/master/example/android
I was not importing the example correctly into Android Studio. The correct way is to drag and drop the project files into AS.

Resources