Skip to content

path_provider package breaks in release mode, if app also depends on device_info_plus, after b2de4df #154580

@rajveermalviya

Description

@rajveermalviya

Steps to reproduce

  1. Clone https://github.com/rajveermalviya/broken_demo
  2. Checkout Flutter SDK to 1cdff36
  3. Run the app, and verify tapping on the button prints the path in console (Working correctly).
  4. Checkout Flutter SDK to b2de4df
  5. Run the app, and verify tapping on the button results in the following error:
W/FlutterEngineCxnRegstry(14828): Attempted to register plugin (a0.a@29f2957) but it was already registered with this FlutterEngine (d0.c@ca74c44).
E/flutter (14828): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
E/flutter (14828): #0      PathProviderApi.getApplicationSupportPath (package:path_provider_android/messages.g.dart:65)
E/flutter (14828): <asynchronous suspension>
E/flutter (14828): #1      getApplicationSupportDirectory (package:path_provider/path_provider.dart:78)
E/flutter (14828): <asynchronous suspension>
E/flutter (14828): #2      _BorkenDemoHomePageState.build.<anonymous closure> (package:broken_demo/main.dart:44)
E/flutter (14828): <asynchronous suspension>
E/flutter (14828): 

Expected results

There should be no errors, it should print the path.

Actual results

Throws a PlatformException(channel-error, Unable to establish connection on channel., null, null)

Code sample

https://github.com/rajveermalviya/broken_demo

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

No response

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.25.0-1.0.pre.110, on macOS 14.6.1 23G93 darwin-arm64, locale en-IN)
    ! Flutter version 3.25.0-1.0.pre.110 on channel [user-branch] at /Users/rajveer/sdk/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision b2de4dfc2b (11 days ago), 2024-08-23 09:44:08 -0700
    • Engine revision 41f539f086
    • Dart version 3.6.0 (build 3.6.0-172.0.dev)
    • DevTools version 2.39.0-dev.15
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/rajveer/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = /Users/rajveer/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2024.1)
    • 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 17.0.11+0-17.0.11b1207.24-11852314)

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

[✓] Connected device (4 available)
    • sdk gphone64 arm64 (mobile)     • emulator-5554         • android-arm64  • Android 14 (API 34) (emulator)
    • macOS (desktop)                 • macos                 • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript • Google Chrome 128.0.6613.114

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: buildBuilding flutter applications with the toolc: regressionIt was better in the past than it is nowfound in release: 3.25Found to occur in 3.25fyi-ecosystemFor the attention of Ecosystem teamhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: path_providerPlugin that provides resolved paths to some platform directoriespackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions