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.

packages folder is added as ignored in "Project Structure -> Modules"

See original GitHub issue

I’m following a few tutorials like bloclibrary.dev where packages folder is used to group local packages used by the application.

The issue is that every time that flutter pub get is executed, IntelliJ/Android Studio adds the packages folder into Project Structure -> Modules -> Excluded Folders so the code is not included in the source.

Steps to Reproduce

  1. Create a project flutter project.
  2. Create a folder packages
  3. From inside of that folder, create a flutter package. For example: flutter create --template package pack1
  4. Add the package into the main pubspec.yaml. For example:
    dependencies:
     flutter:
       sdk: flutter
     auth_repository:
       path: packages/pack1
    
  5. From the root of the project, execute flutter pub get
  6. Regress the project in IntelliJ/Android Studio with reload from Disk option, for example.
  7. Check Project Structure -> Modules -> Excluded Folders and packages folder will be in the list of the excluded folders.

Version info

/home/angelcc/apps/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel beta, 1.20.0, on Linux, locale en_IE.UTF-8)
    • Flutter version 1.20.0 at /home/angelcc/apps/flutter
    • Framework revision 916c3ac648 (3 weeks ago), 2020-08-01 09:01:12 -0700
    • Engine revision d6ee1499c2
    • Dart version 2.9.0 (build 2.9.0-21.10.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at /home/angelcc/apps/Android/Sdk
    • Platform android-30, build-tools 30.0.1
    • ANDROID_SDK_ROOT = /home/angelcc/apps/Android/Sdk
    • Java binary at: /home/angelcc/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /home/angelcc/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763
    • Flutter plugin version 48.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (3 available)
    • AOSP on IA Emulator (mobile) • emulator-5554 • android-x86    • Android 9 (API 28) (emulator)
    • Web Server (web)             • web-server    • web-javascript • Flutter Tools
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 84.0.4147.135

• No issues found!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
alexander-doroshkocommented, Aug 21, 2020

Agree, I’ll fix this and publish new Dart plugin soon.

0reactions
alexander-doroshkocommented, Aug 25, 2020

Fixed. The latest Dart plugin won’t change packages folder exclusion state automatically. Users may exclude or unexclude packages folders manually as needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IntelliJ does not show project folders - Stack Overflow
In File > Project Structure > Modules, click the "+" button, ... directory name is not excluded in Settings | File Types |...
Read more >
Configuring Project Structure | PyCharm Documentation
Within a content root, PyCharm can distinguish between the folders that contain source code, and the ones to be ignored while searching, parsing ......
Read more >
How to ignore files from your npm package | Zell Liew
What you'll do is create a .gitignore file. # .gitignore node_modules. In this case, both Git and npm ignore the node_modules folder.
Read more >
PackageReference in project files - NuGet - Microsoft Learn
Package references, using <PackageReference> MSBuild items, specify NuGet package dependencies directly within project files, as opposed to ...
Read more >
Modules Management — Airflow Documentation
Also make sure to Add init file to your folders. Typical structure of packages¶. This is an example structure that you might have...
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