'Flutter GeneratedPluginRegistrant: can't find android dependency for a plugin

I wrote a Flutter plugin that find the absolute path for a file on an Android system using the PickiT library. The plugin, called Flutter absolute path, has the dependency of the PickiT library added on the plugin build.gradle:

dependencies {
    implementation 'com.github.HBiSoft:PickiT:2.0.5'
}

But when I add this plugin to my app and I try to compile it, I receive this error:

<APP_PATH>/GeneratedPluginRegistrant.java:34: error: cannot access PickiTCallbacks
      flutterEngine.getPlugins().add(new net.altermundi.flutter_absolute_path.FlutterAbsolutePathPlugin());
                                ^
  class file for com.hbisoft.pickit.PickiTCallbacks not found

The only way that I found to make my plugin working is to add the library to my project on the app/build.gradle dependencies also.

How can I make the plugin Android dependency implicit on the whole project without adding it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source