question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unclear how to open a Flutter project in Android Studio

See original GitHub issue

@yjbanov commented on Wed Jan 31 2018

A Flutter project has multiple .gradle files and it’s very easy to open a wrong one when opening a Flutter project for the first time. Android Studio will happily open the file, but many features will not be available. For example, Java code completion may not work, you can’t start a Flutter app from within Android Studio, etc. We need to document it on our site, and perhaps get some assistance from the Flutter plugin itself.

The docs should probably go here: https://flutter.io/using-ide/

/cc @devoncarew @Sfshaza


@sethladd commented on Wed Jan 31 2018

cc @mit-mit @devoncarew


@devoncarew commented on Wed Jan 31 2018

We do plan to make opening projects in Android Studio work better in the near term; /cc @stevemessick.


@stevemessick commented on Tue Feb 06 2018

There are actually a number of issues here, many of which should be documented, if not fixed.

  • Java code completion will be improved in the near term; the class-path needs to be augmented. That’s a code fix, but a doc update should describe how to add more class-path entries when the user includes new dependencies in their Java code. (We can’t anticipate everything.)

  • If you open a Flutter project as the project-root in Android Studio, and you have the Flutter plugin installed, then you should be able to launch a Flutter app (just like IntelliJ); if not that’s a bug. Opening something below the Flutter root in Android Studio will not give you access to Flutter functionality.

  • Full support for Gradle requires opening the Android module as the project-root in Android Studio. We’d like Gradle support to be available from the Flutter project-root but that apparently requires changing the Android Studio code itself (not happening soon).

  • IntelliJ has an Open in Android Studio menu option available when the Android module is selected. We will add that to Android Studio, which already has the Xcode equivalent.


@Purus commented on Fri Mar 09 2018

I am trying to edit an existing plugin(share) to add a feature for a PR. I am facing issues opening the project in Android Studio and IntelliJ IDEA(has Flutter plugin). The flutter packages are not recognized and it looks like a plain file instead of Java file.


@Purus commented on Fri Mar 09 2018

How does Google team work on the plugins?


@yjbanov commented on Fri Mar 09 2018

@Purus, you might be hitting the exact issue described here. There are multiple gradle files, and it’s not obvious which one you are supposed to open. You are probably opening a wrong one.


@Purus commented on Sat Mar 10 2018

Is there anything that can I do to start working on my PR? I don’t see many gradle files in the share plugin directory.


@yjbanov commented on Mon Mar 12 2018

@Purus, you can coordinate with @devoncarew and/or @stevemessick on fixing this (mostly to make sure nobody else is already working on this). The plugin code is https://github.com/flutter/flutter-intellij.


@stevemessick commented on Mon Mar 12 2018

@Purus there is more info here: https://github.com/flutter/flutter-intellij/blob/master/docs/android.md

That doc is an expansion of my previous comment in this thread. It really should be added to the Flutter docs, as @yjbanov mentioned originally.


@Purus commented on Mon Mar 12 2018

Thanks for the response. It’s helpful.

The dependencies section is still unclear. Some sample screenshots and the path for the appcompat-v7 library would be helpful for newcomers.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
dannyroacommented, Sep 16, 2019

I tried following “Creating a new project from existing source code” from the Flutter site (https://flutter.dev/docs/development/tools/android-studio) but AS basically just overwrote my project. Tried importing it but I’m unable to run it. Run button is disabled.

Is it not straightforward to import existing Flutter projects in AS?

0reactions
neilwebercommented, Oct 10, 2020

Still an issue in Android Studio 4.0.2 for Windows. A large number of developers are using VS Code so this problem is pretty major and very annoying. It seems like I should be able to import the project and point AS to the pubspec.yaml.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to open an existing Flutter Project in Android Studio
EASIEST WAY: Drag your project folder and drop to Android Studio. Other ways: Android Studio 1. Android Studio 2. Android Studio 3. Share....
Read more >
Android Studio Setup for Flutter Development - GeeksforGeeks
Step 1: Open the IDE and select Start a new Flutter project. · Step 2: Select the Flutter Application as the project type....
Read more >
Using Android Studio to Develop Flutter Apps - Dummies.com
If you have any open projects, Android Studio doesn't display the Welcome screen. In that case, you can open another project by choosing...
Read more >
Troubleshoot Android Studio
Open your gradle.properties file in Android Studio. · Add the following line to the file: org.gradle.jvmargs=-Djava.net.preferIPv4Stack=true
Read more >
Issues - GitHub
We should implement ProjectOpenProcessor for easy opening existing Flutter projects (I mean those that have never been opened in the IDE ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found