Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After Flutter GIT project checkout, unable to run the project

So I created a Flutter project in IntelliJ Idea Community Edition on machine A and then uploaded the whole project on GitHub. Now I cloned/checked out from GitHub in the same IDE on machine B, performed the following:

  • flutter packages get
  • flutter upgrade
  • Set up the dart path and all other prerequisites

But, I am still unable to run the flutter project from IDE. I mean I can't even press the "Run" button.

Unable to press the run button

Where did I go wrong?

You can try performing the same steps as I did. it if you want. Here's the Git repository code

Edit I can run the same project via terminal.

[Update] As requested by Günter Zöchbauer in the comment log, here's the logs for flutter doctor -v

BoringFlutterProject$ flutter doctor -v
[✓] Flutter (Channel dev, v0.5.8, on Linux, locale en_IN)
    • Flutter version 0.5.8 at /home/daksh/flutter
    • Framework revision e4b989bf3d (8 days ago), 2018-08-09 09:45:44 -0700
    • Engine revision 3777931801
    • Dart version 2.0.0-dev.69.5.flutter-eab492385c

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /home/daksh/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /home/daksh/Android/Sdk
    • Java binary at: /home/daksh/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.1)
    • Android Studio at /home/daksh/android-studio
    • Flutter plugin version 25.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Community Edition (version 2018.1)
    • IntelliJ at /home/daksh/Downloads/idea-IC-181.5281.24
    • Flutter plugin version 25.0.2
    • Dart plugin version 181.4892.1

[✓] VS Code (version 1.26.0)
    • VS Code at /usr/share/code
    • Flutter extension version 2.17.1

[!] Connected devices
    ! No devices available

! Doctor found issues in 1 category.

I posted this question because I'm sure many of us will face the same problem, just like we used to face some issues in AndroidStudio back then

like image 980
Daksh Gargas Avatar asked Aug 17 '18 08:08

Daksh Gargas


People also ask

How do I run a git project from flutter?

Step 1: Open Git Bash. Step 2: Open the flutter project that we want to import. Step 3: Copy the URL and open Git bash to clone the repository. Step 5: The repository will be successfully cloned in the Lenovo folder.

Can I run flutter project in Android Studio?

Step 1: Open the Android Studio and select Tools from the menu bar and click on SDK Manager. Step 2: In the newly open window click on the plugins and in the search bar search for Flutter and Dart and then install it. Step 4: Now after installing Flutter and Dart we are ready to import a Flutter project.

How do I get rid of Project flutter?

In your terminal hit flutter clean command , after that hit flutter pub get . Your all apk's will be delete.


Video Answer


1 Answers

It is an Android Studio issue. The IDE doesn't apply the flutter SDK location for every new project you clone. The workaround is to open the cloned project go to File>Settings(Ctrl+Alt+S). In 'Languages & Frameworks'>Flutter set the SDK path to your Flutter SDK location (e.g. C:\src\flutter). Once you apply the changes and run the 'Packages Get' command the cloned project is fully accessible and understood by Android Studio.

like image 56
Marc Steffens Avatar answered Nov 15 '22 08:11

Marc Steffens