ios - RxSwift - Playground 执行失败 : Couldn't lookup symbols

标签 ios swift cocoapods rx-swift swift-playground

我创建了一个新项目并使用 pod 安装 RxSwift。然后我创建了一个 Playground 并编写了以下代码:

import UIKit
import RxSwift
import PlaygroundSupport

var name = "hello"
let names = Variable(["Good"])  

但控制台显示此错误:

Playground execution failed:

error: Couldn't lookup symbols: __T07RxSwift8VariableCACyxGxcfC
__T07RxSwift8VariableCMa

最佳答案

Podfile 试试这个:

platform :ios, '11.0'

target 'RxSwiftPlayground' do
  use_frameworks!

  # Pods for RxSwiftPlayground
  pod 'RxSwift', '~> 4.0'
end

post_install do |installer|

    installer.pods_project.build_configurations.each do |config|
        config.build_settings.delete('CODE_SIGNING_ALLOWED')
        config.build_settings.delete('CODE_SIGNING_REQUIRED')
    end

    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['CONFIGURATION_BUILD_DIR'] = '$PODS_CONFIGURATION_BUILD_DIR'
        end
    end
end

或者

  1. 删除“import RxSwift”这一行
  2. 清理(Cmd + Shift + K)
  3. 构建(有错误)
  4. 放回‘import RxSwift’

来自 https://github.com/ReactiveX/RxSwift/issues/1660

关于ios - RxSwift - Playground 执行失败 : Couldn't lookup symbols,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54107540/

相关文章:

ios - TableView 单元格不可转换为 Void

ios - 更改 iOS SwiftUI 键盘扩展高度

swift 包管理器。错误 : Found multiple packages with the name. ..?

ios - iOS GCM 示例的无效 Podfile

ios - 如何在 'aspect fit' 模式下将 UIImageView 裁剪为新的 UIImage?

ios - SnapKit - UITableView 高度不随单元格的动态内容而变化

swift - XCSourceEditorCommandInvocation swift 扩展导致 "unrecognized selector sent to instance"异常

ios - UIPageViewController 从子 UIViewController 上的控件过渡

ios - 如何将 Swift 3.0 编译的 POD 应用到 2.2 的项目中?

ios - 无法使用迦太基安装依赖项