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

Transitive dependencies on multiple implementations of a federated plugin result in no auto-registration #118401

Closed
Decoder07 opened this issue Jan 12, 2023 · 10 comments · Fixed by #122046
Assignees
Labels
a: plugins Support for writing, building, and running plugin packages P2 Important issues not at the top of the work list r: fixed Issue is closed as already fixed in a newer version tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@Decoder07
Copy link

This is only happening on iOS.

Steps to Reproduce

  1. Add shared_preferences: 2.0.16 in pubspec.yaml
  2. Run the application having use of shared_preferences such as:

final prefs = await SharedPreferences.getInstance();

Expected results:

We should get the SharedPreferences object.

Actual results:

Screenshot 2023-01-12 at 10 54 15 PM

Logs
No issues found on running flutter analyze

flutter doctor -v output:

[✓] Flutter (Channel stable, 3.3.8, on macOS 13.1 22C65 darwin-arm, locale en-IN)
    • Flutter version 3.3.8 on channel stable at /Users/decode/work/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 52b3dc25f6 (9 weeks ago), 2022-11-09 12:09:26 +0800
    • Engine revision 857bd6b74c
    • Dart version 2.18.4
    • DevTools version 2.15.0

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/decode/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[!] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    ✗ CocoaPods installed but not working.
        You appear to have CocoaPods installed but it is not working.
        This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to invoke it.
        This can usually be fixed by re-installing CocoaPods.
      To re-install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.

Complete code for reproducing the issue can be found here

@stuartmorgan
Copy link
Contributor

  1. Add shared_preferences: 2.0.16 in pubspec.yaml

Did you reproduce this in a new project, or are you updating an existing project?

Could you provide the contents of .dart_tool/flutter_build/dart_plugin_registrant.dart in the project that's reproducing this? From that error message it looks like it's not registering an implementation for iOS.

@danagbemava-nc danagbemava-nc added in triage Presently being triaged by the triage team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds labels Jan 13, 2023
@mrqaidi
Copy link

mrqaidi commented Jan 21, 2023

same issue

@Decoder07
Copy link
Author

Sorry, @stuartmorgan for the late response. I encountered this in the existing project while upgrading the package version.

Please find the dart_plugin_registrant.dart file:

//
// Generated file. Do not edit.
// This file is generated from template in file `flutter_tools/lib/src/flutter_plugins.dart`.
//

// @dart = 2.12

import 'dart:io'; // flutter_ignore: dart_io_import.
import 'package:path_provider_android/path_provider_android.dart';
import 'package:shared_preferences_android/shared_preferences_android.dart';
import 'package:url_launcher_android/url_launcher_android.dart';
import 'package:path_provider_ios/path_provider_ios.dart';
import 'package:url_launcher_ios/url_launcher_ios.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:path_provider_linux/path_provider_linux.dart';
import 'package:share_plus/share_plus.dart';
import 'package:shared_preferences_linux/shared_preferences_linux.dart';
import 'package:url_launcher_linux/url_launcher_linux.dart';
import 'package:path_provider_macos/path_provider_macos.dart';
import 'package:shared_preferences_foundation/shared_preferences_foundation.dart';
import 'package:url_launcher_macos/url_launcher_macos.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:path_provider_windows/path_provider_windows.dart';
import 'package:share_plus/share_plus.dart';
import 'package:shared_preferences_windows/shared_preferences_windows.dart';
import 'package:url_launcher_windows/url_launcher_windows.dart';

@pragma('vm:entry-point')
class _PluginRegistrant {

  @pragma('vm:entry-point')
  static void register() {
    if (Platform.isAndroid) {
      try {
        PathProviderAndroid.registerWith();
      } catch (err) {
        print(
          '`path_provider_android` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        SharedPreferencesAndroid.registerWith();
      } catch (err) {
        print(
          '`shared_preferences_android` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        UrlLauncherAndroid.registerWith();
      } catch (err) {
        print(
          '`url_launcher_android` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

    } else if (Platform.isIOS) {
      try {
        PathProviderIOS.registerWith();
      } catch (err) {
        print(
          '`path_provider_ios` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        UrlLauncherIOS.registerWith();
      } catch (err) {
        print(
          '`url_launcher_ios` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

    } else if (Platform.isLinux) {
      try {
        PackageInfoPlusLinuxPlugin.registerWith();
      } catch (err) {
        print(
          '`package_info_plus` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        PathProviderLinux.registerWith();
      } catch (err) {
        print(
          '`path_provider_linux` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        SharePlusLinuxPlugin.registerWith();
      } catch (err) {
        print(
          '`share_plus` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        SharedPreferencesLinux.registerWith();
      } catch (err) {
        print(
          '`shared_preferences_linux` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        UrlLauncherLinux.registerWith();
      } catch (err) {
        print(
          '`url_launcher_linux` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

    } else if (Platform.isMacOS) {
      try {
        PathProviderMacOS.registerWith();
      } catch (err) {
        print(
          '`path_provider_macos` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        SharedPreferencesFoundation.registerWith();
      } catch (err) {
        print(
          '`shared_preferences_foundation` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        UrlLauncherMacOS.registerWith();
      } catch (err) {
        print(
          '`url_launcher_macos` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

    } else if (Platform.isWindows) {
      try {
        PackageInfoPlusWindowsPlugin.registerWith();
      } catch (err) {
        print(
          '`package_info_plus` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        PathProviderWindows.registerWith();
      } catch (err) {
        print(
          '`path_provider_windows` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        SharePlusWindowsPlugin.registerWith();
      } catch (err) {
        print(
          '`share_plus` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        SharedPreferencesWindows.registerWith();
      } catch (err) {
        print(
          '`shared_preferences_windows` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

      try {
        UrlLauncherWindows.registerWith();
      } catch (err) {
        print(
          '`url_launcher_windows` threw an error: $err. '
          'The app may not function as expected until you remove this plugin from pubspec.yaml'
        );
        rethrow;
      }

    }
  }
}

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 22, 2023
@stuartmorgan
Copy link
Contributor

It's definitely missing. Do you have shared_preferences_foundation in your pubspec.lock?

@Decoder07
Copy link
Author

Yes I can see:

  shared_preferences:
    dependency: "direct main"
    description:
      name: shared_preferences
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.0.16"
  shared_preferences_android:
    dependency: transitive
    description:
      name: shared_preferences_android
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.0.14"
  shared_preferences_foundation:
    dependency: transitive
    description:
      name: shared_preferences_foundation
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.1.2"
  shared_preferences_ios:
    dependency: transitive
    description:
      name: shared_preferences_ios
      url: "https://pub.dartlang.org"
    source: hosted
    version: "2.1.1"

@stuartmorgan
Copy link
Contributor

Thanks, that narrows it down somewhat. What about in .flutter-plugins-dependencies?

It's very odd that you still have shared_preferences_ios in that file; that may be the issue (although it shouldn't be, so if it is that's a bug in the resolution logic). Could you also provide your flutter pub deps output?

@Decoder07
Copy link
Author

Yes, it's there in .flutter-plugins-dependencies:

{
  "name": "shared_preferences_foundation",
  "path": "/Users/decode/work/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_foundation-2.1.2/",
  "native_build": true,
  "dependencies": []
},
{
  "name": "shared_preferences_ios",
  "path": "/Users/decode/work/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences_ios-2.1.1/",
  "native_build": true,
  "dependencies": []
}

flutter pub deps output:

Dart SDK 2.18.4
Flutter SDK 3.3.8
hmssdk_flutter_example 1.0.7+7
|-- avatar_glow 2.0.2
|   '-- flutter...
|-- badges 2.0.3
|   '-- flutter...
|-- cupertino_icons 1.0.5
|-- draggable_widget 2.0.0
|   '-- flutter...
|-- dropdown_button2 1.9.2
|   '-- flutter...
|-- file_picker 5.2.5
|   |-- ffi...
|   |-- flutter...
|   |-- flutter_plugin_android_lifecycle 2.0.7
|   |   '-- flutter...
|   |-- flutter_web_plugins...
|   |-- path...
|   |-- plugin_platform_interface...
|   '-- win32...
|-- firebase_analytics 10.1.0
|   |-- firebase_analytics_platform_interface 3.3.17
|   |   |-- _flutterfire_internals...
|   |   |-- firebase_core...
|   |   |-- flutter...
|   |   |-- meta...
|   |   '-- plugin_platform_interface...
|   |-- firebase_analytics_web 0.5.1+8
|   |   |-- _flutterfire_internals...
|   |   |-- firebase_analytics_platform_interface...
|   |   |-- firebase_core...
|   |   |-- firebase_core_web...
|   |   |-- flutter...
|   |   |-- flutter_web_plugins...
|   |   '-- js...
|   |-- firebase_core...
|   |-- firebase_core_platform_interface...
|   '-- flutter...
|-- firebase_core 2.4.1
|   |-- firebase_core_platform_interface...
|   |-- firebase_core_web 2.1.0
|   |   |-- firebase_core_platform_interface...
|   |   |-- flutter...
|   |   |-- flutter_web_plugins...
|   |   |-- js...
|   |   '-- meta...
|   |-- flutter...
|   '-- meta...
|-- firebase_crashlytics 3.0.10
|   |-- firebase_core...
|   |-- firebase_core_platform_interface 4.5.2
|   |   |-- collection...
|   |   |-- flutter...
|   |   |-- flutter_test...
|   |   |-- meta...
|   |   '-- plugin_platform_interface...
|   |-- firebase_crashlytics_platform_interface 3.3.10
|   |   |-- _flutterfire_internals 1.0.12
|   |   |   |-- collection...
|   |   |   |-- firebase_core...
|   |   |   |-- firebase_core_platform_interface...
|   |   |   |-- flutter...
|   |   |   '-- meta...
|   |   |-- collection...
|   |   |-- firebase_core...
|   |   |-- flutter...
|   |   |-- meta...
|   |   '-- plugin_platform_interface...
|   |-- flutter...
|   '-- stack_trace 1.10.0
|       '-- path...
|-- firebase_dynamic_links 5.0.11
|   |-- firebase_core...
|   |-- firebase_core_platform_interface...
|   |-- firebase_dynamic_links_platform_interface 0.2.3+26
|   |   |-- _flutterfire_internals...
|   |   |-- firebase_core...
|   |   |-- flutter...
|   |   |-- meta...
|   |   '-- plugin_platform_interface...
|   |-- flutter...
|   |-- meta...
|   '-- plugin_platform_interface 2.1.3
|       '-- meta...
|-- firebase_performance 0.9.0+10
|   |-- firebase_core...
|   |-- firebase_core_platform_interface...
|   |-- firebase_performance_platform_interface 0.1.1+29
|   |   |-- _flutterfire_internals...
|   |   |-- firebase_core...
|   |   |-- flutter...
|   |   '-- plugin_platform_interface...
|   |-- firebase_performance_web 0.1.1+18
|   |   |-- _flutterfire_internals...
|   |   |-- firebase_core...
|   |   |-- firebase_core_web...
|   |   |-- firebase_performance_platform_interface...
|   |   |-- flutter...
|   |   |-- flutter_web_plugins...
|   |   '-- js...
|   '-- flutter...
|-- flutter 0.0.0
|   |-- characters 1.2.1
|   |-- collection 1.16.0
|   |-- material_color_utilities 0.1.5
|   |-- meta 1.8.0
|   |-- sky_engine 0.0.99
|   '-- vector_math 2.1.2
|-- flutter_foreground_task 3.10.0
|   |-- flutter...
|   |-- platform 3.1.0
|   |-- plugin_platform_interface...
|   |-- shared_preferences...
|   |-- shared_preferences_android...
|   '-- shared_preferences_ios 2.1.1
|       |-- flutter...
|       '-- shared_preferences_platform_interface...
|-- flutter_launcher_icons 0.11.0
|   |-- args 2.3.1
|   |-- checked_yaml 2.0.2
|   |   |-- json_annotation...
|   |   |-- source_span...
|   |   '-- yaml...
|   |-- cli_util 0.3.5
|   |   |-- meta...
|   |   '-- path...
|   |-- image 3.1.3
|   |   |-- archive 3.3.5
|   |   |   |-- crypto...
|   |   |   |-- path...
|   |   |   '-- pointycastle 3.6.2
|   |   |       |-- collection...
|   |   |       |-- convert 3.1.1
|   |   |       |   '-- typed_data...
|   |   |       '-- js...
|   |   |-- meta...
|   |   '-- xml...
|   |-- json_annotation 4.7.0
|   |   '-- meta...
|   |-- path...
|   '-- yaml 3.1.1
|       |-- collection...
|       |-- source_span...
|       '-- string_scanner...
|-- flutter_linkify 5.0.2
|   |-- flutter...
|   '-- linkify 4.1.0
|-- flutter_staggered_grid_view 0.6.2
|   '-- flutter...
|-- flutter_svg 1.0.3
|   |-- flutter...
|   |-- meta...
|   |-- path_drawing 1.0.1
|   |   |-- flutter...
|   |   |-- meta...
|   |   |-- path_parsing 1.0.1
|   |   |   |-- meta...
|   |   |   '-- vector_math...
|   |   '-- vector_math...
|   |-- vector_math...
|   '-- xml 5.4.1
|       |-- collection...
|       |-- meta...
|       '-- petitparser 5.1.0
|           '-- meta...
|-- flutter_test 0.0.0
|   |-- async...
|   |-- boolean_selector 2.1.0
|   |   |-- source_span...
|   |   '-- string_scanner...
|   |-- characters...
|   |-- clock...
|   |-- collection...
|   |-- fake_async 1.3.1
|   |   |-- clock...
|   |   '-- collection...
|   |-- flutter...
|   |-- matcher 0.12.12
|   |   '-- stack_trace...
|   |-- material_color_utilities...
|   |-- meta...
|   |-- path...
|   |-- source_span 1.9.0
|   |   |-- collection...
|   |   |-- path...
|   |   '-- term_glyph...
|   |-- stack_trace...
|   |-- stream_channel 2.1.0
|   |   '-- async...
|   |-- string_scanner 1.1.1
|   |   '-- source_span...
|   |-- term_glyph 1.2.1
|   |-- test_api 0.4.12
|   |   |-- async...
|   |   |-- boolean_selector...
|   |   |-- collection...
|   |   |-- matcher...
|   |   |-- meta...
|   |   |-- source_span...
|   |   |-- stack_trace...
|   |   |-- stream_channel...
|   |   |-- string_scanner...
|   |   '-- term_glyph...
|   '-- vector_math...
|-- fluttertoast 8.1.2
|   |-- flutter...
|   '-- flutter_web_plugins...
|-- focus_detector 2.0.1
|   |-- flutter...
|   '-- visibility_detector 0.2.2
|       '-- flutter...
|-- google_fonts 3.0.1
|   |-- crypto 3.0.2
|   |   '-- typed_data...
|   |-- flutter...
|   |-- http...
|   '-- path_provider...
|-- hmssdk_flutter 1.3.0
|   '-- flutter...
|-- http 0.13.5
|   |-- async 2.9.0
|   |   |-- collection...
|   |   '-- meta...
|   |-- http_parser 4.0.2
|   |   |-- collection...
|   |   |-- source_span...
|   |   |-- string_scanner...
|   |   '-- typed_data 1.3.1
|   |       '-- collection...
|   |-- meta...
|   '-- path 1.8.2
|-- image_gallery_saver 1.7.1
|   '-- flutter...
|-- intl 0.18.0
|   |-- clock 1.1.1
|   |-- meta...
|   '-- path...
|-- logger 1.1.0
|-- package_info_plus 3.0.2
|   |-- ffi 2.0.1
|   |-- flutter...
|   |-- flutter_web_plugins 0.0.0
|   |   |-- characters...
|   |   |-- collection...
|   |   |-- flutter...
|   |   |-- js...
|   |   |-- material_color_utilities...
|   |   |-- meta...
|   |   '-- vector_math...
|   |-- http...
|   |-- meta...
|   |-- package_info_plus_platform_interface 2.0.1
|   |   |-- flutter...
|   |   |-- meta...
|   |   '-- plugin_platform_interface...
|   |-- path...
|   '-- win32 3.1.3
|       '-- ffi...
|-- path_provider 2.0.11
|   |-- flutter...
|   |-- path_provider_android 2.0.22
|   |   |-- flutter...
|   |   '-- path_provider_platform_interface...
|   |-- path_provider_ios 2.0.11
|   |   |-- flutter...
|   |   '-- path_provider_platform_interface...
|   |-- path_provider_linux 2.1.7
|   |   |-- ffi...
|   |   |-- flutter...
|   |   |-- path...
|   |   |-- path_provider_platform_interface...
|   |   '-- xdg_directories 0.2.0+3
|   |       |-- meta...
|   |       |-- path...
|   |       '-- process 4.2.4
|   |           |-- file...
|   |           |-- path...
|   |           '-- platform...
|   |-- path_provider_macos 2.0.7
|   |   |-- flutter...
|   |   '-- path_provider_platform_interface...
|   |-- path_provider_platform_interface 2.0.5
|   |   |-- flutter...
|   |   |-- platform...
|   |   '-- plugin_platform_interface...
|   '-- path_provider_windows 2.1.3
|       |-- ffi...
|       |-- flutter...
|       |-- path...
|       |-- path_provider_platform_interface...
|       '-- win32...
|-- permission_handler 10.2.0
|   |-- flutter...
|   |-- meta...
|   |-- permission_handler_android 10.2.0
|   |   |-- flutter...
|   |   '-- permission_handler_platform_interface...
|   |-- permission_handler_apple 9.0.7
|   |   |-- flutter...
|   |   '-- permission_handler_platform_interface...
|   |-- permission_handler_platform_interface 3.9.0
|   |   |-- flutter...
|   |   |-- meta...
|   |   '-- plugin_platform_interface...
|   '-- permission_handler_windows 0.1.2
|       |-- flutter...
|       '-- permission_handler_platform_interface...
|-- pip_flutter 0.0.3
|   |-- collection...
|   |-- flutter...
|   |-- flutter_widget_from_html_core 0.8.5+3
|   |   |-- csslib 0.17.2
|   |   |   '-- source_span...
|   |   |-- flutter...
|   |   |-- fwfh_text_style 2.22.08+1
|   |   |   '-- flutter...
|   |   '-- html 0.15.1
|   |       |-- csslib...
|   |       '-- source_span...
|   |-- path_provider...
|   |-- pedantic 1.11.1
|   |-- visibility_detector...
|   |-- wakelock...
|   '-- xml...
|-- provider 6.0.5
|   |-- collection...
|   |-- flutter...
|   '-- nested 1.0.0
|       '-- flutter...
|-- qr_code_scanner 1.0.1
|   |-- flutter...
|   |-- flutter_web_plugins...
|   '-- js 0.6.4
|-- share_plus 6.3.0
|   |-- cross_file 0.3.3+2
|   |   |-- js...
|   |   '-- meta...
|   |-- ffi...
|   |-- file 6.1.4
|   |   |-- meta...
|   |   '-- path...
|   |-- flutter...
|   |-- flutter_web_plugins...
|   |-- meta...
|   |-- mime 1.0.4
|   |-- share_plus_platform_interface 3.2.0
|   |   |-- cross_file...
|   |   |-- flutter...
|   |   |-- meta...
|   |   |-- mime...
|   |   |-- path_provider...
|   |   |-- plugin_platform_interface...
|   |   '-- uuid 3.0.7
|   |       '-- crypto...
|   |-- url_launcher_linux...
|   |-- url_launcher_platform_interface...
|   |-- url_launcher_web...
|   |-- url_launcher_windows...
|   '-- win32...
|-- shared_preferences 2.0.16
|   |-- flutter...
|   |-- shared_preferences_android 2.0.14
|   |   |-- flutter...
|   |   '-- shared_preferences_platform_interface...
|   |-- shared_preferences_foundation 2.1.2
|   |   |-- flutter...
|   |   '-- shared_preferences_platform_interface...
|   |-- shared_preferences_linux 2.1.2
|   |   |-- file...
|   |   |-- flutter...
|   |   |-- path...
|   |   |-- path_provider_linux...
|   |   |-- path_provider_platform_interface...
|   |   '-- shared_preferences_platform_interface...
|   |-- shared_preferences_platform_interface 2.1.0
|   |   |-- flutter...
|   |   '-- plugin_platform_interface...
|   |-- shared_preferences_web 2.0.4
|   |   |-- flutter...
|   |   |-- flutter_web_plugins...
|   |   '-- shared_preferences_platform_interface...
|   '-- shared_preferences_windows 2.1.2
|       |-- file...
|       |-- flutter...
|       |-- path...
|       |-- path_provider_platform_interface...
|       |-- path_provider_windows...
|       '-- shared_preferences_platform_interface...
|-- tuple 2.0.1
|-- uni_links 0.5.1
|   |-- flutter...
|   |-- uni_links_platform_interface 1.0.0
|   |   |-- flutter...
|   |   '-- plugin_platform_interface...
|   '-- uni_links_web 0.1.0
|       |-- flutter...
|       |-- flutter_web_plugins...
|       '-- uni_links_platform_interface...
|-- url_launcher 6.1.7
|   |-- flutter...
|   |-- url_launcher_android 6.0.22
|   |   |-- flutter...
|   |   '-- url_launcher_platform_interface...
|   |-- url_launcher_ios 6.0.17
|   |   |-- flutter...
|   |   '-- url_launcher_platform_interface...
|   |-- url_launcher_linux 3.0.1
|   |   |-- flutter...
|   |   '-- url_launcher_platform_interface...
|   |-- url_launcher_macos 3.0.1
|   |   |-- flutter...
|   |   '-- url_launcher_platform_interface...
|   |-- url_launcher_platform_interface 2.1.1
|   |   |-- flutter...
|   |   '-- plugin_platform_interface...
|   |-- url_launcher_web 2.0.13
|   |   |-- flutter...
|   |   |-- flutter_web_plugins...
|   |   '-- url_launcher_platform_interface...
|   '-- url_launcher_windows 3.0.1
|       |-- flutter...
|       '-- url_launcher_platform_interface...
'-- wakelock 0.5.6
    |-- flutter...
    |-- meta...
    |-- wakelock_macos 0.4.0
    |   |-- flutter...
    |   |-- flutter_web_plugins...
    |   '-- wakelock_platform_interface...
    |-- wakelock_platform_interface 0.3.0
    |   |-- flutter...
    |   '-- meta...
    |-- wakelock_web 0.4.0
    |   |-- flutter...
    |   |-- flutter_web_plugins...
    |   |-- js...
    |   '-- wakelock_platform_interface...
    '-- wakelock_windows 0.2.1
        |-- flutter...
        |-- wakelock_platform_interface...
        '-- win32...

@stuartmorgan
Copy link
Contributor

The dependency on shared_preferences_ios is coming from flutter_foreground_task. I've filed Dev-hwang/flutter_foreground_task#131

I'll need to investigate why having two transitive dependencies implementing the same platform is causing no registration to be output, since that shouldn't happen. In the meantime, until flutter_foreground_task is updated you'll need to stay on shared_preferences 2.0.15.

@stuartmorgan stuartmorgan self-assigned this Jan 22, 2023
@stuartmorgan stuartmorgan added tool Affects the "flutter" command-line tool. See also t: labels. plugin P2 Important issues not at the top of the work list and removed in triage Presently being triaged by the triage team labels Jan 22, 2023
@GaelleJoubert

This comment was marked as off-topic.

@stuartmorgan stuartmorgan added the a: plugins Support for writing, building, and running plugin packages label Feb 9, 2023
@stuartmorgan stuartmorgan changed the title shared_preferences 2.0.16 version is throwing MissingPluginException(iOS only) Transitive dependencies on multiple implementations of a federated plugin result in no auto-registration Mar 6, 2023
stuartmorgan added a commit to stuartmorgan/flutter that referenced this issue Mar 6, 2023
Fixes issues related to transitive dependencies on plugins with Dart
implementations:
- Ensures that if there are multiple transitive dependencies including
  the app-facing-package-selected default, the default is picked.
  Previously it was order-dependent what would happen, and in some
  cases no implementation would be picked.
- Allows registration of a package's implementation even if the
  app-facing package is not present, as long as there is only one
  possible implementation (or the app directly picks one). There are
  cases where depending on just a platform implementation of a package,
  rather than the app-facing package, is useful. (E.g.,
  shared_preferences_linux depends directly on path_provider_linux.)

Also fixes a bug where an implementation conflict error was being gated
behind a flag that was only supposed to be hiding an (overly-strict at
the moment) error about plugin pubspec definitions.

Fixes flutter#99083
Fixes flutter#118401
@danagbemava-nc danagbemava-nc added the r: fixed Issue is closed as already fixed in a newer version label Mar 10, 2023
@github-actions
Copy link

github-actions bot commented Apr 3, 2023

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 Apr 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: plugins Support for writing, building, and running plugin packages P2 Important issues not at the top of the work list r: fixed Issue is closed as already fixed in a newer version tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants