首页 > 解决方案 > Xcode v12.5 - 打开 SQlite DB 时生成错误

问题描述

在将 Xcode 从 v12.4 升级到 12.5 后,在 React-Native 项目上工作,出现构建错误。曾经在 Xcode v12.4 中完美运行

我已经缩小到导致此构建错误的行:

var db: OpaquePointer?
let _path = path ?? "widgetdb.sqlite3";
sqlite3_open(_path, &db) <-- This is the culprit!

错误日志:

Undefined symbols for architecture x86_64:
  "Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:
      generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in SQLiteDatabase.o

任何帮助将不胜感激!谢谢!!

标签: iosreact-nativesqliteswift5xcode12.5

解决方案


今天遇到类似的问题,但错误是 Alamofire

就我而言,我通过删除解决了它

"\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\""

来自项目搜索路径中的 LIBRARY_SEARCH_PATHS


推荐阅读