仅本机(c/c++)flutter插件

发布于 2025-01-21 07:14:32 字数 732 浏览 1 评论 0原文

问题

我目前正在编写一个小型的幻影插件,其中我使用了一些第三方C ++依赖项。为了在iOS和Android上使用它,我正在用C ++编写它。 该部分正常。

但是,使用flutter Create -T插件my_plugin生成插件还将添加kotlin/java源到Android部分(及其等于iOS)。
我的问题是我认为我不需要这些文件。我认为他们的汇编需要一些时间,并且乍一看也为项目增加了复杂性。

解决方案尝试

我已经在

还有一个 flutter存储库中的问题我能说的那样,还没有规范的方式。

如果我简单地删除*。java android/src/main/org/my_plugin我收到错误

插件my_plugin没有在

中定义的主类

插件my_plugin在我现在无法测试iOS方面定义

,但是类似的问题可能会出现。问题

如何摆脱此扑朔迷离插件中的所有Java/Kotlin和Objectivec/Swift文件? 即使仅关于Android部分的任何技巧将不胜感激。

Problem

I am currently writing a small Flutter plugin in which I use some third-party C++ dependencies. In order to use it on both iOS and Android I am writing it in C++.
That part works fine.

However, generating a plugin with flutter create -t plugin my_plugin will also add Kotlin/Java sources to the Android part (and their equivalent to iOS).
My issue is that I don't think I need these files. I assume their compilation takes some time, and they also add complexity to the project at first glance.

Solution attempt

I have found information on making native-activity apps, but I am not making an app.

There is also an issue on the flutter repository discussing native-only plugins, but as far as I can tell there is no canonical way yet.

If I simply remove the *.java file in android/src/main/org/my_plugin I get an error

The plugin my_plugin doesn't have a main class defined in

I cannot test the iOS side of things right now, but a similar problem would probably emerge.

Question

How can I get rid of all Java/Kotlin and ObjectiveC/Swift files in this Flutter plugin?
Any tips even only about the Android part would be greatly appreciated.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文