问题标签 [xcframework]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ios - 生成 xcframework 库时出现 xcodebuild 错误“不支持具有多个平台的二进制文件”
我正在尝试从 MyFramework.framework 文件生成 xcframework 文件。
我正在运行以下命令:
xcodebuild -create-xcframework -framework "MyFramework.framework" -输出 "MyFramework.xcframework"
之后我收到此错误:
错误:不支持具有多个平台的二进制文件'/Users/nicco/myFramework/MyFramework.framework/MyFramework'
它有什么问题?谢谢!
ios - 是否可以使用 Swift 5.1 工具链为我的 xcframework 库启用位码
启用这些标志
.xarchive 成功构建,然后使用 xcodebuild 打包到 xcframework 中。
但是当它包含在启用了位码的测试应用程序中时,它会抱怨
“...不包含位码。您必须在启用位码的情况下重建它(Xcode 设置 ENABLE_BITCODE),从供应商处获取更新的库,或禁用此目标的位码。”
当它使用最新的 swift (Swift5.3) 构建时,确实启用了位码并且运行良好。
为什么 5.1 不起作用,是否有任何文档指出启用位码实际上与 .archive 正确捆绑的版本?
ios - 自定义 XCFramework 的消费者如何访问标头文档?
我正在开发一个 XCFramework,它的公共接口有很多很好的文档(如 docstrings/Markup Apple Markup Formatting Reference)。但是,当框架包含在客户端应用程序中时,当您在方法或属性上单击 Option-Click(“快速帮助”)时,Xcode 不会显示任何文档。
在 SDK.xcframework 文件夹中有一个文件Headers/SDK-Swift.h
,它实际上包含所有这些文档字符串。
有没有办法告诉 Xcode 使用随附的文档?
我的 XCFramework 是通过xcodebuild -create-xcframework -framework x.framework -framework y.framework -output z.xcframework
ios - 错误:不支持将桥接头与模块接口一起使用 Command CompileSwiftSources failed with a nonzero exit code
我已经切换到Xcode12
我的一个静态库应用程序。我正在尝试制作 XCFramework 分发。运行构建命令后,
当我切换Build Settings -> Build Libraries for Distribution
到时,我遇到了错误YES
,
这个答案有效,但不幸.xcframework
的是创建需要设置选项分布YES
。
如何解决这个问题?
ios - 无法使用包含 pod 的 xcframework 发布应用程序
语境
我开发了一个包含以下 pod 的框架:CryptoSwift、SwiftyRSA 和 PromiseKit。我将它作为 xcframework 分发到 cocoapods 中。这就是我生成 xcframework 的方式:
问题
当我之前在 App Store Connect 中验证应用程序以进行分发时,它无法显示以下错误消息:
App Store Connect Operation Error Invalid Bundle Structure - 不允许使用二进制文件“MySDKTest.app/Frameworks/MySDK.framework/Frameworks/Pods_MySDK.framework/Pods_MySDK”。除了受支持的捆绑包的有效 CFBundleExecutable 之外,您的应用程序不能包含独立的可执行文件或库。有关 iOS 应用程序包结构的信息,请参阅https://developer.apple.com/go/?id=bundle-structure上的包编程指南 。
App Store Connect 操作错误 捆绑包无效。'MySDKTest.app/Frameworks/MySDK.framework' 中的包包含不允许的嵌套包。
App Store Connect 操作错误 捆绑包无效。“MySDKTest.app/Frameworks/MySDK.framework”的捆绑包包含不允许的文件“Frameworks”。
ios - 具有 Pod 依赖项的 XCFramework
我们的目标是创建一个框架来隐藏我们的内部代码并向我们的客户提供 SDK。我们已经考虑创建满足我们要求的 XCFramework。互联网上也建议使用伞形框架,但大多建议避免这种方法。我们的框架依赖于我们通过 Pods 使用的一些第三方库。
问题:XCFramework 不编译 pod 框架。我们收到类似“未找到 Xyz(Pod) 模块”的错误。即使我们从客户端添加 pod,它也不起作用。
创建 XCFramework 的代码如下
1)为iOS平台创建档案
2) 为 iOS-Simulator 平台创建存档
3) 从档案中创建一个 XCFramework
我们成功获得了 ABC XCFramework,但依赖项不包含在 XCFramework 中。有什么解决办法吗?或者有什么方法可以将框架搜索路径设置为客户端?或任何替代方法?
ios-frameworks - 自定义框架:dyld:找不到符号:_$s11CryptoSwift7PaddingO5pkcs7yA2CmFWC
我正在使用使用 3 个不同的 cocoapods 创建的自定义框架。我通过删除创建的 xc 框架在客户端应用程序中使用此自定义框架。一旦客户端应用程序启动,它就会崩溃并显示以下崩溃日志。我已经看到这个问题在苹果和 stackoverflow 上报告了许多其他地方,但我找不到适合我的正确答案。现在我已经将客户端应用程序和框架 repo 都上传到了 github,这样任何试图帮助我的人都可以真正看到设置和代码。请任何人都可以建议一个适当的解决方案来解决这个问题。
框架:https ://github.com/deepesh259nitk/PaymentsKit
客户端应用程序:https ://github.com/deepesh259nitk/PaymentClient
应用启动时的崩溃日志
dyld:找不到符号:$s11CryptoSwift7PaddingO5pkcs7yA2CmFWC 引用自:/Users/deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator/PaymentsKit.framework/PaymentsKit 预期在:/Users/deepesh .vasthimal/Library/Developer/CoreSimulator/Devices/A0876375-98D5-4215-A139-68F29E787388/data/Containers/Bundle/Application/D954732B-EDDC-478E-85C4-C5C9B14FDDEE/PaymentClient.app/Frameworks/CryptoSwift.framework/CryptoSwift在/Users/deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator/PaymentsKit.framework/PaymentsKit dyld:启动,加载依赖库DYLDSHAREDCACHEDIR=/Users/deepesh.vasthimal/Library /Developer/CoreSimulator/Caches/dyld/19H2/com.apple.CoreSimulator.SimRuntime。iOS-14-0.18A372 DYLDROOTPATH=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLDLIBRARYPATH=/Users/deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator:/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS。 platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLDINSERTLIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/ iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/de18A372 DYLDROOTPATH=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLDLIBRARYPATH=/Users/ deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator:/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer /CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLDINSERTLIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library /Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/de18A372 DYLDROOTPATH=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLDLIBRARYPATH=/Users/ deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator:/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer /CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLDINSERTLIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library /Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/de巨大/下载/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLDLIBRARYPATH=/Users/deepesh.vasthimal/Library/Developer/ Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator:/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS .simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLDINSERTLIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes /iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/de巨大/下载/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLDLIBRARYPATH=/Users/deepesh.vasthimal/Library/Developer/ Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator:/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS .simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLDINSERTLIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes /iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/deapp/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLDLIBRARYPATH=/Users/deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient- bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator:/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources /RuntimeRoot/usr/lib/system/introspection DYLDINSERTLIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents /Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/deapp/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLDLIBRARYPATH=/Users/deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient- bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator:/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources /RuntimeRoot/usr/lib/system/introspection DYLDINSERTLIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents /Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/desimruntime/Contents/Resources/RuntimeRoot DYLDLIBRARYPATH=/Users/deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator:/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents /Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLDINSERTLIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app /Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/desimruntime/Contents/Resources/RuntimeRoot DYLDLIBRARYPATH=/Users/deepesh.vasthimal/Library/Developer/Xcode/DerivedData/PaymentClient-bnsircrdeaciebedmqaliyxezdqe/Build/Products/Debug-iphonesimulator:/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents /Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLDINSERTLIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app /Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/de/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLDINSERTLIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording .dylib:/用户/de/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLDINSERTLIBRARIES=/Users/deepesh.vasthimal/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording .dylib:/用户/desimruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/desimruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Users/de
我尝试过的事情。
- 我尝试完全删除 CryptoSwift 以查看是否由于此 pod 发生错误,但随后崩溃发生在另一个 pod 的 JOSESwift 上。
- 我已经意识到崩溃的发生是因为它在 CryptoSwift 和 JOSESwift 中都找不到特定的符号。而且当我使用这些库的特定方法时。
例如,如果我使用 CryptoSwift 的 AES 方法,如果您看到我的框架 repo,通过添加以下代码会发生崩溃,仅包含 pod 不会崩溃,但使用它会导致崩溃。
_$s11CryptoSwift7PaddingO5pkcs7yA2CmFWC
- 我还在客户端应用程序中添加 pod,这样如果您看到客户端应用程序 repo,它不会被添加两次,您将看到所有 3 个 pod 都已添加。
ios - 具有 Firebase 依赖项的 iOS 动态框架
我们正在开发一个框架,它依赖于一些 firebase 依赖项,如登录、分析等。一旦我们的框架开发完成,我们会将其分发给我们的客户。
需要注意的事情是
- 代码不可见(最好的建议是创建 XCFramework)
- 如果可能,创建一个动态框架而不是静态框架
- 可以通过 Swift 包管理器或 cocoapods 分发
我们尝试过的
- 我们尝试使用 pod 创建一个动态框架,然后创建一个 XCFramework。但是在导入客户端应用程序时,找不到 pods 模块
- 我们创建了静态库并手动添加了 firebase(直接在项目中)而不是 pod,在这种情况下 XCFramework 没有被导入
我们已尝试创建 带有 Pods Dependencies 的 XCFramework,如此处所述(对于动态框架)
可以使用隐藏代码伞框架和通用库,但是对于firebase,这种方法是典型的,并且在许多地方也没有在互联网上建议有没有其他/替代方法可以满足我们的要求?
ios - XCFramework, dyld 缓存加载错误:共享缓存文件 open() 失败
我正在努力让一个使用 XCFramework 的框架工作。我已经构建了 arm64/armv7 和单独的 x86_64 框架,就好像它们是普通的 cocoapods 一样,然后我xcodebuild -create-xcframework
将它们合并到一个运行良好的 xcframework 中。当我之后尝试使用框架时,虽然我得到了这个运行时错误
我已经搜索了很多 dyld 类型错误,但它们似乎都不是这种类型,并且有似乎不适用于我的场景的解决方案。
xcframework 通过 cocoapods 放入我的项目中,并在 podspec 中定义了它的依赖关系。正如您从错误中看到的那样,它试图使用来自我的依赖项之一的 lottie 框架中的符号,但似乎找不到它,这很奇怪。我已经确定 lottie 框架确实被拉入了我的项目(如果我从源代码而不是 xcframework 构建它,它就可以工作)。所以不知道为什么它在链接框架时遇到问题。
如果您需要任何更具体的信息来提供帮助,请告诉我