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

invalid item 'Flutter for Android' in the dependencies list #70759

Closed
alexobviously opened this issue Nov 18, 2020 · 4 comments
Closed

invalid item 'Flutter for Android' in the dependencies list #70759

alexobviously opened this issue Nov 18, 2020 · 4 comments

Comments

@alexobviously
Copy link

I've been working with Flutter for a while and have made a number of projects with no problems, but I just started trying to create a new one and have run into what seems to be an impassable problem.

There are a number of things happening as far as I can tell, but I think this is at the core of it:
In Android Studio, in project structure (cmd+;), I have this in the 'Problems' tab:
Module a_test_app_android: invalid item 'Flutter for Android' in the dependencies list

I first encountered this in the live project that I'm trying to create, but have since tried to do it with a completely blank project and it's still there.

Note: this test project actually will still run! However, in my live project, I'm encountering some other problems that I'm fairly sure are caused by this and are the reason I realised it was broken in the first place, lots of MissingPluginExceptions and these do crash it:

E/flutter (10005): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/package_info)
E/flutter (10005): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider)
E/flutter (10005): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getDatabasesPath on channel com.tekartik.sqflite)

etc.

Investigating this led to me to GeneratedPluginRegistrant.java, which looks like this in my test project:
Screenshot 2020-11-18 at 20 18 12

And this led me to

I have tried:

  • flutter clean
  • reinstalling flutter
  • different flutter channels
  • reinstalling android studio
  • downgrading to an android studio that I know worked

None of these change anything; I always have this missing Flutter for Android issue in project structure:
Screenshot 2020-11-18 at 20 30 17

A project that I created before this issue started happening, with all the same packages and virtually the same implementation (new project is a variant of the old project) is still working fine.

flutter doctor -v

Alexs-MacBook-Pro:~ alex$ flutter doctor -v
[✓] Flutter (Channel stable, 1.22.4, on Mac OS X 10.14.6 18G2022 darwin-x64, locale en-GB)
    • Flutter version 1.22.4 at /Users/alex/Developer/flutter
    • Framework revision 1aafb3a8b9 (5 days ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /Users/alex/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.9.3

[!] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[!] IntelliJ IDEA Community Edition (version 2020.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

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

[✓] Connected device (1 available)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)

! Doctor found issues in 2 categories.

You'll notice that in my doctor log it also says that the flutter and dart plugins are not installed for Android Studio (don't worry about IDEA, I don't use it for flutter), but they definitely are, and I wasn't receiving this warning until recently either, so I feel it may be related, but I'm not really sure.

I'm on Android Studio 4.1.1, on OSX Mojave 10.14.6

@pedromassangocode
Copy link

You'll notice that in my doctor log it also says that the flutter and dart plugins are not installed for Android Studio (don't worry about IDEA, I don't use it for flutter), but they definitely are, and I wasn't receiving this warning until recently either, so I feel it may be related, but I'm not really sure.

This is not an error it is just a warning caused by a new IntelliJ/Android Studio upgrade where they changed the path of the plugins and Flutter can't find/detect them. You can still using Flutter without problems.

Investigating this led to me to GeneratedPluginRegistrant.java, which looks like this in my test project:
Screenshot 2020-11-18 at 20 18 12

Those are red because you opened Android related files using an IDE that does not have an Android plugin, we recommend Android Studio to open such files to get auto completion and some more benefits. This is not an problem as well.

Note: this test project actually will still run! However, in my live project, I'm encountering some other problems that I'm fairly sure are caused by this and are the reason I realised it was broken in the first place, lots of MissingPluginExceptions and these do crash it:

E/flutter (10005): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/package_info)
E/flutter (10005): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider)
E/flutter (10005): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getDatabasesPath on channel com.tekartik.sqflite)

The crash related to path_provider is known and there is already a issue to track it #46679. For the sqflite package, please open an issue in their repository because it is not part of Flutter team plugins. For package_info there is an open issue #69009, please share your thoughts there.

Module a_test_app_android: invalid item 'Flutter for Android' in the dependencies list

Please open a specific issue related to this issue.

Closing this because this single issue talks about many issues and some of them are already reported, opened or they are invalid.

@alexobviously
Copy link
Author

alexobviously commented Nov 18, 2020

Those are red because you opened Android related files using an IDE that does not have an Android plugin, we recommend Android Studio to open such files to get auto completion and some more benefits. This is not an problem as well.

This is Android Studio.

I'm aware that these plugins have had these issues reported because I've been through all of the proposed solutions and none of them worked for me.

The crux of the issue is this:
I can take code that works in a previous project with the same packages, and put it in a new project with those packages and it will throw MissingPluginExceptions. Therefore it must be something to do with how Android Studio/flutter create generates the projects in recent versions, I assume.

I would happily open a specific issue for this, but I'm not quite sure how to phrase it or what other information to provide?

@pedromassangocode
Copy link

I suggest you to focus in describing how to reproduce the issue and talk about one single issue. I just closing this because it is too confuse and talks about so many issue at the same time.

@github-actions
Copy link

github-actions bot commented Aug 9, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants