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

[path_provider] path_provider_android 2.0.10 throws MissingPluginException on older versions of Flutter #95706

Closed
JamesKarl opened this issue Dec 23, 2021 · 9 comments · Fixed by flutter/plugins#4637
Assignees
Labels
c: regression It was better in the past than it is now p: path_provider Plugin that provides resolved paths to some platform directories P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version

Comments

@JamesKarl
Copy link

The following code works well with path_provider 2.0.1. After upgrading to 2.0.8, it throws "MissingPluginException(No implementation found for method getApplicationDocumentsDirectory.

final doc = await getApplicationDocumentsDirectory();
@sara010
Copy link

sara010 commented Dec 23, 2021

same problem

@6a209
Copy link

6a209 commented Dec 23, 2021

same problem , yesterday is ok ,today suddenly broken,Debug found a class not found
image

i use ^2.0.1 is will auto update 2.0.8; but is ok, the problem is cause by path_provider_android , it's publish a new version 11 hour ago

image

@maheshmnj maheshmnj added the in triage Presently being triaged by the triage team label Dec 23, 2021
@maheshmnj
Copy link
Member

Hi @JamesKarl, Thanks for filing the issue. I ran the official sample code using path_provider: ^2.0.8 and I could not reproduce the issue.

Please share the output of flutter doctor -v and a minimal and complete reproducible code sample.

flutter doctor -v
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-arm, locale en-GB)
    • Flutter version 2.8.1 at /Users/mahesh/Documents/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (7 days ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/mahesh/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.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 13.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.10.2

[✓] 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.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)

[✓] IntelliJ IDEA Community Edition (version 2021.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 60.1.4
    • Dart plugin version 212.5080.8

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

[✓] Connected device (3 available)
    • Redmi K20 Pro (mobile) • 192.168.1.7:5555 • android-arm64  • Android 11 (API 30)
    • macOS (desktop)        • macos            • darwin-arm64   • macOS 12.1 21C52 darwin-arm
    • Chrome (web)           • chrome           • web-javascript • Google Chrome 96.0.4664.110

• No issues found!

@maheshmnj maheshmnj added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 23, 2021
@medyas
Copy link

medyas commented Dec 23, 2021

@maheshmnj Having the same issue:

E/flutter (32229): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)
E/flutter (32229): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154)
E/flutter (32229): <asynchronous suspension>
E/flutter (32229): #1      getApplicationDocumentsDirectory (package:path_provider/path_provider.dart:115)
E/flutter (32229): <asynchronous suspension>
E/flutter (32229): #2      HiveX.initFlutter (package:hive_flutter/src/hive_extensions.dart:12)
E/flutter (32229): <asynchronous suspension>
E/flutter (32229): #3      main (package:app/main.dart:28)
E/flutter (32229): <asynchronous suspension>

It was building using the lastest path_provider_android-2.0.10
Quick fix for this is to override the version and have 2.0.9

dependency_overrides:
  path_provider_android: 2.0.9

The plugin was trying to connect through plugins.flutter.io/path_provider as per the path_provider_platform but the latest path_provider_android:2.0.10 update changed the channel to plugins.flutter.io/path_provider_android
The override fixed the issue.

@stuartmorgan
Copy link
Contributor

What version of Flutter is everyone who is seeing this using? If it's 2.5 or earlier, that's a known bug in the update to the Android implementation. If it's 2.8, that's unexpected.

@stuartmorgan stuartmorgan self-assigned this Dec 23, 2021
@stuartmorgan stuartmorgan changed the title [path_provider] 2.0.8 invoke getApplicationDocumentsDirectory throws MissingPluginException [path_provider] path_provider_android 2.0.10 throws MissingPluginException on older versions of Flutter Dec 23, 2021
@stuartmorgan stuartmorgan added P1 High-priority issues at the top of the work list p: first party p: path_provider Plugin that provides resolved paths to some platform directories platform-android Android applications specifically c: regression It was better in the past than it is now and removed waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Dec 23, 2021
@medyas
Copy link

medyas commented Dec 23, 2021

@stuartmorgan only failing in version 2.5.3, this did not occur in the latest 2.8.1

@gabrielchavestoro
Copy link

gabrielchavestoro commented Dec 23, 2021

Same problem here. The dependencie override suggested by @medyas worked but I wouldn't like to deploy a version with it. Will we be able to revert the change until today? Can I help with something?

stuartmorgan added a commit to stuartmorgan/plugins that referenced this issue Dec 23, 2021
PR flutter#4617 added a dependency on Dart auto-registration, but forgot to
bump the SDK requirement to 2.8 (where that feature was introduced for
Android). In order to fix older versions, this restores the previous
channel name so that the implementation here is compatible with the
default method channel registration used by Flutter 2.5 and earlier.

A follow-up will restore the package-specific channel name, but also
change the SDK requirement to >=2.8. This must be published first so
that the last published version that claims 2.5 compatibility actually
works with 2.5.

Fixes flutter/flutter#95706
stuartmorgan added a commit to stuartmorgan/plugins that referenced this issue Dec 23, 2021
PR flutter#4617 added a dependency on Dart auto-registration, but forgot to
bump the SDK requirement to 2.8 (where that feature was introduced for
Android). In order to fix older versions, this restores the previous
channel name so that the implementation here is compatible with the
default method channel registration used by Flutter 2.5 and earlier.

A follow-up will restore the package-specific channel name, but also
change the SDK requirement to >=2.8. This must be published first so
that the last published version that claims 2.5 compatibility actually
works with 2.5.

Fixes flutter/flutter#95706
stuartmorgan added a commit to flutter/plugins that referenced this issue Dec 23, 2021
PR #4617 added a dependency on Dart auto-registration, but forgot to
bump the SDK requirement to 2.8 (where that feature was introduced for
Android). In order to fix older versions, this restores the previous
channel name so that the implementation here is compatible with the
default method channel registration used by Flutter 2.5 and earlier.

A follow-up will restore the package-specific channel name, but also
change the SDK requirement to >=2.8. This must be published first so
that the last published version that claims 2.5 compatibility actually
works with 2.5.

Fixes flutter/flutter#95706
@stuartmorgan
Copy link
Contributor

path_provider_android 2.0.11 has been published to fix this.

@maheshmnj maheshmnj added r: fixed Issue is closed as already fixed in a newer version and removed in triage Presently being triaged by the triage team labels Dec 26, 2021
@github-actions
Copy link

github-actions bot commented Jan 9, 2022

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 Jan 9, 2022
ValentinVignal pushed a commit to ValentinVignal/flutter__packages that referenced this issue Feb 23, 2023
PR flutter#4617 added a dependency on Dart auto-registration, but forgot to
bump the SDK requirement to 2.8 (where that feature was introduced for
Android). In order to fix older versions, this restores the previous
channel name so that the implementation here is compatible with the
default method channel registration used by Flutter 2.5 and earlier.

A follow-up will restore the package-specific channel name, but also
change the SDK requirement to >=2.8. This must be published first so
that the last published version that claims 2.5 compatibility actually
works with 2.5.

Fixes flutter/flutter#95706
@flutter-triage-bot flutter-triage-bot bot added the package flutter/packages repository. See also p: labels. label Jul 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: regression It was better in the past than it is now p: path_provider Plugin that provides resolved paths to some platform directories P1 High-priority issues at the top of the work list package flutter/packages repository. See also p: labels. platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants