FG
📱 Mobile & Cross-PlatformGoogle

[shared_preferences] Android exception: `Unable to establish connection on channel: "dev.flutter.pigeon.shared_preferences_android.SharedPreferencesApi.getAll"`

Fresh6 months ago
Mar 14, 20260 views
Confidence Score86%
86%

Problem

Long explanation of what is happening https://github.com/flutter/flutter/issues/153075#issuecomment-3313363609 TLDR: Update your Android Gradle Plugin version to 8.9.1 or higher and ensure that all of your android plugins are using at least AGP 8.9.1 or higher. If you have a reproduction that is using AGP 8.9.1 and higher for an app and all of its plugins please add a comment with your reproduction. Steps to reproduce 1. Use old api of shared preferences. 2. Build the app. Expected results It should work with old api of shared preferences. Actual results Getting exception as below Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel: "dev.flutter.pigeon.shared_preferences_android.SharedPreferencesApi.getAll"., null, null) Code sample <details open><summary>Code sample</summary> [code block] </details> Screenshots or Video <details open> <summary>Screenshots / Video demonstration</summary> [Upload media here] </details> Logs <details open><summary>Logs</summary> [code block] </details> Flutter Doctor output <details open><summary>Doctor output</summary> [code block] </details>

Error Output

Exception: PlatformException(channel-error, Unable to establish connection on channel: "dev.flutter.pigeon.shared_preferences_android.SharedPreferencesApi.getAll"., null, null)

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: [shared_preferences] Android exception: `Unable to establish connection on channel: "dev.flutter.pigeon.shared_preferences_android.SharedPreferencesApi.getAll"`

Low Risk

Hi @shubham-ctl Which `shared_preferences_android` package version you are using? (Please check it on `pubspec.lock` file). Please also provide the entire output of `flutter run -v` to see the complete crash stack trace. Thanks!

84

Trust Score

1 verification

100% success
  1. 1

    Hi @shubham-ctl

    Which `shared_preferences_android` package version you are using? (Please check it on `pubspec.lock` file).

  2. 2

    Please also provide the entire output of `flutter run -v` to see the complete cr

    Please also provide the entire output of `flutter run -v` to see the complete crash stack trace. Thanks!

Validation

Resolved in flutter/flutter GitHub issue #153075. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

flutterdartmobileplatform-androidcustomer:-crowdp:-shared_preferencespackage