我正在 Macbook Air M1 2020 型号上使用 Arctic Fox 2020.3.1(ARM 版本 - 专为 Apple 芯片设计),运行 flutter 项目。我能够成功地在 Android 模拟器上运行,但是当我尝试在连接的 iOS 设备或 iOS 模拟器上运行时,“pod install”命令失败并且构建失败。但是当我在 Rosetta 2 上打开终端并尝试手动“pod install”时,它会安装所有 pod,之后我可以从 XCODE 运行构建,但不能从 Android Studio 运行构建,所以我的问题是:Android Studio 内的终端是否运行在Apple上(而不是在rosetta 2上)这就是它失败的原因。
\n注意:我已经更改了终端的配置以在rosetta 2上强制运行它。
\n\n当我尝试从 studio 运行 ios 时会发生这种情况
\nThe plugins `flutter_full_pdf_viewer, flutter_webview_plugin, onesignal_flutter` use a deprecated version of the Android embedding.\nTo avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. …Run Code Online (Sandbox Code Playgroud) 我正在iOS上尝试使用Kotlin Native,我想尝试的一件事是使用Swot实现Kotlin定义的接口.但是,当我尝试将Swift对象传递回Kotlin代码时,我最终崩溃了.
我正在使用kotlin gradle插件版本1.2.30和kotlin本机版本0.6.1
最小的例子如下.Kotlin代码正在编译为名为KotlinCommon的框架,然后将其包含在xcode项目中.
DemoClass.kt
class DemoClass {
fun process(dependency: Dependency) {
dependency.foo()
}
}
interface Dependency {
fun foo()
}
Run Code Online (Sandbox Code Playgroud)
SwiftDependency.swift
import KotlinCommon
class SwiftDependency : KotlinCommonDependency {
func foo() {
NSLog("hello")
}
}
Run Code Online (Sandbox Code Playgroud)
然后,从我的iOS UI尝试运行
let module = KotlinCommonDemoClass()
let dependency = SwiftDependency()
module.process(dependency: dependency)
Run Code Online (Sandbox Code Playgroud)
第三行导致崩溃,并出现以下错误:
*** NSForwarding: warning: object 0x101858d20 of class 'KotlinNativeDemo.SwiftDependency' does not implement methodSignatureForSelector: -- trouble ahead
Unrecognized selector -[KotlinNativeDemo.SwiftDependency toKotlin:]
Run Code Online (Sandbox Code Playgroud)
Kotlin Native不支持此用例吗?或者可能有一些我配置错误的东西?