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.

All files/ folders are "excluded" except for `lib` directory in plugin template from Android Studio

See original GitHub issue

In Android Studio, all files/ folders in a new project are “excluded” except for lib directory in plugin template.

Steps to Reproduce

  • Run flutter create --template=plugin --platforms=android,ios test
  • Open project in Android Studio
  • Observe the bug: Files are highlighted in yellow, indicating that they are “excluded” (e.g. from indexing in Android Studio) Screenshot 2021-06-25 at 22 18 48

Temporary workarounds:

  • delete .packages file (deprecated file), or
  • Comment out the plugin block in pubspec.yaml

See how these work:

CleanShot 2021-06-25 at 22 33 29

Version info

Flutter doctor -v

[✓] Flutter (Channel dev, 2.3.0-24.0.pre, on macOS 11.5 20G5033c darwin-x64, locale en-GB)
    • Flutter version 2.3.0-24.0.pre at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2b9537c783 (2 weeks ago), 2021-06-11 22:11:53 -0700
    • Engine revision ddbac024d1
    • Dart version 2.14.0 (build 2.14.0-188.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/zen/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio 4.2.1.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode-beta.app/Contents/Developer
    • Xcode 13.0, Build version 13A5155e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio 4.2.1.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[!] Android Studio
    • Android Studio at /Applications/Android Studio Arctic Fox Beta 4.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[!] Android Studio
    • Android Studio at /Applications/Android Studio Bumble Bee Canary 2.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.2)
    • IntelliJ at /Users/zen/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.2)
    • IntelliJ at /Users/zen/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7442.40/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] IntelliJ IDEA Ultimate Edition (version 2021.1.1)
    • IntelliJ at /Users/zen/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7142.45/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.57.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.23.0

[✓] Connected device (2 available)
    • CUBOT J3 (mobile) • W56AX048C18D0009553 • android-arm    • Android 8.1.0 (API 27)
    • Chrome (web)      • chrome              • web-javascript • Google Chrome 91.0.4472.114
    ! Error: Rover12 is busy: Making Rover12 ready for development. Xcode will continue when Rover12 is finished. (code -10)

! Doctor found issues in 2 categories

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
stevemessickcommented, Sep 28, 2021

Actually, the yellow background does not mean exclusion. Indexing is correct. You can find references to the plugin code from both the plugin and the example app.

The background is different than expected because the project directory is also marked as a library. I forget why that is being done, but it enables some functionality, I believe. If you really don’t want the background color changed, and don’t need whatever feature is enabled, you can use the project structure dialog to remove the dependence on Flutter Plugins from the plugin module.

1reaction
stevemessickcommented, Jun 29, 2021

This is a dup of #1369, but leaving open to investigate the work-arounds mentioned here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio : Exclude files in build folder from search result
To put it simply, and to actually exclude build paths from your search, ... individual files and Recursively include or exclude all files...
Read more >
Configure Android Studio - Android Developers
Both configuration files are stored in the configuration folder for Android Studio. The name of the folder depends on your Studio version.
Read more >
Add build dependencies - Android Developers
Learn how to add build dependencies using the Gradle build system in Android Studio.
Read more >
Manage manifest files - Android Developers
This page describes how our build tools ingest manifest files to determine the ultimate look and experience of your app.
Read more >
AAPT2 - Android Developers
Android Gradle Plugin 3.0.0 and higher enables AAPT2 by default. ... When passing whole directories, AAPT2 recompiles all files in the ...
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