问题描述
我试图制作一个flutter插件,所以我通过。尝试运行ios示例时出现错误。以下是我在运行ios示例应用程序时获得的日志。
I'm trying to make a flutter plugin, so I created a plugin by steps provided on https://flutter.dev/docs/development/packages-and-plugins/developing-packages. I'm getting an error when I try to run ios example. Below is the log I'm getting while running ios example app.
有人可以帮我吗?
添加支持。 code>在根文件夹中。这不会更改 example / 目录中的示例代码。所提供的示例仍然适用于Android的Java和iOS的Objective-C。因此,然后我从Android Studio创建了一个插件,通过选中包括iOS代码的Swift支持选项创建了iOS的Swift支持,它使用swift而不是Objective-C创建了一个示例。然后问题解决了。Got the issue. when we create a plugin by command on the terminal it creates a plugin with default Java for Android and Objective-C for iOS. It can be changed to Kotlin for Android and Swift for iOS by using a command, but it will add support to only android/ and ios/ in the root folder. This does not change the example code in example/ directory. The provided examples are still in Java for Android and Objective-C for iOS. So then I created a plugin from Android Studio, I created a Swift support for iOS by checking an option 'Include Swift support for ios code', it created an example with swift instead of Objective-C. Then the issue is solved.
这篇关于Flutter插件iOS构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!