小编Bru*_*let的帖子

“pod install”命令在 Android Studio Arctic Fox mac m1 的终端中不起作用

我正在 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在此输入图像描述

\n

当我尝试从 studio 运行 ios 时会发生这种情况

\n
The 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)

terminal android-studio flutter rosetta-2

7
推荐指数
1
解决办法
2732
查看次数

将Kotlin接口的Swift实现传递给Kotlin方法时出错

我正在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不支持此用例吗?或者可能有一些我配置错误的东西?

ios kotlin swift kotlin-native

2
推荐指数
1
解决办法
238
查看次数