Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run flutter project in a subdirectory #801

Open
yyoon opened this issue Mar 9, 2017 · 11 comments
Open

Cannot run flutter project in a subdirectory #801

yyoon opened this issue Mar 9, 2017 · 11 comments
Milestone

Comments

@yyoon
Copy link

yyoon commented Mar 9, 2017

Steps to Reproduce

Open a parent directory which contains a flutter project in a subdirectory.
Create a run configuration with Flutter, and specify the the subdir/lib/main.dart as its entry point.

After creating this run configuration, it cannot be used to actually run, because the run button is disabled.

Version info

[✓] Flutter (on Linux, channel unknown)
    • Flutter at /usr/local/google/home/youngseokyoon/Programming/fuchsia/lib/flutter
    • Framework revision f613fef23b (2 hours ago), 2017-03-09 12:09:20
    • Engine revision 6e54f5e31f
    • Tools Dart version 1.23.0-dev.2.0

[✓] Android toolchain - develop for Android devices (Android SDK 25.0.2)
    • Android SDK at /usr/local/google/home/youngseokyoon/Android/Sdk
    • Platform android-25, build-tools 25.0.2
    • ANDROID_HOME = /usr/local/google/home/youngseokyoon/Android/Sdk
    • OpenJDK Runtime Environment (build 1.8.0_112-google-v7-146844476-143772575)

[✓] Android Studio (version 2.1)
    • Android Studio at /opt/android-studio-2.1
    • Gradle version 2.14.1

[✓] Android Studio (version 2.2)
    • Android Studio at /opt/android-studio-2.2
    • Gradle version 2.14.1

[✓] IntelliJ IDEA Community Edition (version 2016.3)
    • Dart plugin version 163.13137
    • Flutter plugin version 0.1.11.2

[✓] Connected devices
    • Pixel C • 5C08000423 • android-arm • Android 7.0 (API 24)
@devoncarew
Copy link
Member

Thanks for the report!

Currently we do expect to have one flutter project per IntelliJ module. So, your IntelliJ project can have one or more modules; each modules would have one flutter project, with the pubspec.yaml file in the root of the IntelliJ module.

We could potentially support other configurations (multiple flutter projects per IntelliJ module), but we find the above solution to be simple, and the convention means that less configuration is required.

If you open the directory containing lib/ do things work for you?

@yyoon
Copy link
Author

yyoon commented Mar 15, 2017

I see. The "one project having multiple flutter module" model may not work very well for our situation. We have a project root directory, which contains various dev tools, test data, regular Dart packages, as well as flutter projects importing those Dart packages. I was hoping to run the flutter projects by just adding a new run configuration of type "Flutter" and specifying the main.dart and working directory.

And yes, if I open the flutter project directory as the root, then running the app seems to work fine.

@devoncarew devoncarew added this to the Backlog milestone Mar 15, 2017
@devoncarew
Copy link
Member

OK, that's good data, thanks for letting us know. Not certain that we'll address this, but something we'll consider as we go.

@ianloic
Copy link

ianloic commented Jul 13, 2017

I think this is a blocker for using IntelliJ effectively in the Fuchsia tree. It will probably matter less once we have an SDK and do more development outside of the Fuchsia tree.

@devoncarew
Copy link
Member

@ianloic, what's the best guide for getting set up to develop against the Fuchsia tree? I'd like to see what the layout of the source tree looks like.

@devoncarew
Copy link
Member

Working reworking how we define Flutter modules in IntelliJ for the upcoming plugin release - it may help out with this issue.

@faisalmohd83
Copy link

faisalmohd83 commented Jun 26, 2019

Unsure if the issue linked to the same but Google/GitHub search ended up here.
I've tried building the Flutter project with Android Studio/VSCode/CLI, had not luck!
flutter doctor results well.

pasting my issue below

Multiple projects in this build have project directory

Digging more into the issue:

* Error running Gradle:
ProcessException: Process "/Users/%USER%/FlutterProjects/MovieDirect/android/gradlew" exited abnormally:

FAILURE: Build failed with an exception.

* What went wrong:
Multiple projects in this build have project directory '/Users/%USER%/FlutterProjects/MovieDirect/android': [:, :MovieDirect]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
  Command: /Users/%USER%/FlutterProjects/MovieDirect/android/gradlew app:properties

Please review your Gradle project setup in the android/ folder.

I've tried bunch solution like cleaning up the build folders, flutter clean, rm -rf android\.gradle etc.

Had been struggling with same from the last couple of days without any solution.
Would highly appreciate any input could lead to a solution.

@maelfosso
Copy link

I Have the same problem.
did you find any solution @faisalmohd83 ?

@zeeshannoor11786
Copy link

@faisalmohd83 @maelfosso any of you got solution ? I'm having same issue.

@faisalmohd83
Copy link

@maelfosso @zeeshannoor11786

Sorry guys, I've moved out of the project for a while.

@jschaf
Copy link

jschaf commented Nov 20, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants