Jordan Hall
Jordan Hall

Reputation: 371

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 Android Studio Header

And here's flutter doctor enter image description here

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!

Upvotes: 1

Views: 3216

Answers (2)

pranay
pranay

Reputation: 21

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:

  1. Enable Dart support for the project (checkbox)
  2. Set the Dart SDK path (on my machine it was "C:\flutter\bin\cache\dart-sdk")
  3. Select the modules to enable Dart support

Screenshot of Android Studio Dart settings

Upvotes: 2

Doc
Doc

Reputation: 11651

Open pubspec.yaml in your IDE and click on packages get option image

This should fix your problem.

Upvotes: 0

Related Questions