Skip to content

Namespace collision with flutter_plugin_android_lifecycle #6

@SvenSchoene

Description

@SvenSchoene

This is very unfortunate and I don't have a good solution for this. Personally, I'll be forking this repository for a while and change the name until this has been "officially" resolved.

After updating the image_picker dependency (https://pub.dev/packages/image_picker), I am now getting this error:

...\app-name\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:17: error: a type with the same simple name is already defined by the single-type-import of FlutterAndroidLifecyclePlugin
import io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin;

(Because of this change in image_picker: flutter/plugins@3595743#diff-94aec143fa15896e4c8aca6854f7ecd7R19)

...\app-name\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java looks like this:

/**
 * Generated file. Do not edit.
 */
public final class GeneratedPluginRegistrant {
  public static void registerWith(PluginRegistry registry) {
    if (alreadyRegisteredWith(registry)) {
      return;
    }
    FlutterAndroidLifecyclePlugin.registerWith(registry.registrarFor("com.anggach.flutterandroidlifecycle.FlutterAndroidLifecyclePlugin"));
    FlutterAndroidLifecyclePlugin.registerWith(registry.registrarFor("io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin"));

...
  }
...

This package is the package with the competing namespace: https://pub.dev/packages/flutter_plugin_android_lifecycle

Again, this is super unfortunate because either you have to change the namespace of this package, or communicate with the maintainers of the other package to change it on their end.

[EDIT] Here is the counter-issue I've opened in the other repository for this to facilitate communication: flutter/flutter#51222

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions