仅本机(c/c++)flutter插件
问题
我目前正在编写一个小型的幻影插件,其中我使用了一些第三方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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论