Flutter生成的PluginRegistrant:可以找到插件的Android依赖

发布于 2025-01-26 06:43:53 字数 994 浏览 2 评论 0 原文

我编写了一个乱七八糟的插件,该插件可以使用 pickit )图书馆。该插件称为 flutter absolute path ,在插件< a href =“ https://gitlab.com/elrepo.io/flutter_absolute_path/-/blob/master/master/android/android/build.gradle#l32“ rel =“ nofollow noreferrer

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

”将此插件添加到我的应用程序中,然后尝试对其进行编译,我会收到此错误:

<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

我发现插件正常工作的唯一方法是将库添加到我的项目上的 app/build.gradle 依赖项。

如何在不添加的情况下将插件依赖性依赖于整个项目?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烟酒忠诚 2025-02-02 06:43:53

插件,称为 flutter绝对路径插件 依赖项{ 实现'com.github.hbisoft:pickit:2.0.5' }

插件应该使用 api api api 而不是实现,例如:

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

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'
}

The plugin should rather use api instead of implementation, like so:

dependencies {
    api 'com.github.HBiSoft:PickiT:2.0.5'
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文