简体   繁体   English

访问包装在 XCFramework 中的 Static 库

[英]Accessing Static Library wrapped in XCFramework

We have Static library (*.a) wrapped in XCFramework distributed by a third-party SDK.我们有 Static 库 (*.a) 包装在 XCFramework 中,由第三方 SDK 分发。 Attached is screenshot of the SDK's directory structure and info.plist.附上SDK目录结构和info.plist截图。

Our project structure -> Main App - SubProject - SDK我们的项目结构 -> 主应用程序 - 子项目 - SDK

Existing integration was with static library.现有的集成是与 static 库。 We had SDK's header file imported in sub-project's headers.我们在子项目的标题中导入了 SDK 的 header 文件。

What is not working?什么不工作?

  • Importing XCFramework gives No such module $FRAMEWORK导入 XCFramework No such module $FRAMEWORK
  • Accessing SDK content gives Cannot find $FRAMEWORK in scope -- Expected as import is not working.访问 SDK 内容会导致Cannot find $FRAMEWORK in scope - 预计导入不起作用。

What I have tried so far?到目前为止我尝试了什么?

  • Linker flags -ObjC -all_load Linker 标志-ObjC -all_load
  • Setting Library & header search paths -- Path for header file is bit tricky with directory names ios-arm64_armv7_armv7s & ios-arm64_i386_x86_64-simulator设置库和 header 搜索路径 -- header 文件的路径对于目录名称ios-arm64_armv7_armv7sios-arm64_i386_x86_64-simulator有点棘手
  • Creating SPM repo for the framework.为框架创建 SPM 存储库。

Only way I can get this working is copying .h file from XCFramework to the project and updating sub-project's header file.我可以让这个工作的唯一方法是将.h文件从 XCFramework 复制到项目并更新子项目的 header 文件。

That seems wrong though.但这似乎是错误的。 Any ideas what I am missing?有什么我想念的想法吗?

XCFramework 目录结构

信息列表

Possibly you need a Bridging-Header.h then import your iOS header as:可能您需要一个Bridging-Header.h然后将您的 iOS header 导入为:

#import "iOS/ADBMobile.h"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 xcframework 生成中处理 swift protobuf(静态库)依赖 - How to handle swift protobuf(Static library) dependency in xcframework generation 在单独的类中访问包装在静态方法中的NSURLSessionTasks的委托 - Accessing delegate of NSURLSessionTasks wrapped in static method in separate class dyld:库未加载设备的 XCFramework 但适用于模拟器 - dyld: Library not loaded with XCFramework for device but works with Simulator 访问Cocoa Touch静态库中的主队列 - Accessing main Queue in Cocoa Touch Static Library 从两个 static 库(libssl.a、libcrypto.a)中创建 XCFramework - Create XCFramework out of two static libraries (libssl.a, libcrypto.a) 生成 xcframework 库时 xcodebuild 错误“不支持具有多个平台的二进制文件” - xcodebuild error "binaries with multiple platforms are not supported" while generating xcframework library 是否可以使用 Swift 5.1 工具链为我的 xcframework 库启用位码 - Is it possible to enable bitcode for my xcframework library using Swift 5.1 toolchain 为什么在创建 XCFramework 时出现此错误?:为 iOS 模拟器构建时,在路径中找不到库 - Why am I getting this error while creating XCFramework?: While building for iOS Simulator, no library was found in path XCFramework 创建错误:库 -arm64_armv7 中的 CodingKeys(stringValue: “SupportedPlatform”, intValue: nil) 为空 - XCFramework creation error: The CodingKeys(stringValue: “SupportedPlatform”, intValue: nil) is empty in library -arm64_armv7 具有两个可执行文件的框架(“包装”静态库) - Framework (“wrapped” static lib) with two executables
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM