问题标签 [swift-custom-framework]

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.

0 投票
1 回答
1695 浏览

swift - 由于“内部”保护级别,“结果”无法访问

我想使用 URLSession 为通用 API 请求创建自定义框架。所以我使用了这个链接。我将使用这个项目作为自定义框架。因此,为了使用它,我已经通过 . 更改了它的访问说明符。并且open使用这个链接我已经将它导入到我的项目中。我已经完成了以下代码来调用发布请求

但它给了我一个关于“成功”、“错误”和以下几行的错误:

从各种链接中,我SpeedyResponse通过以下方式在课堂上进行了更改

但它仍然没有修复。

0 投票
2 回答
447 浏览

ios - 如何将带有故事板和 xib 的 swift 项目转换为自定义 sdk/框架

我正在创建一个 sdk,我想在其中使用我的 swift 应用程序的所有功能、故事板和 xib。因此,如果我想将我的应用程序导入其他应用程序,那么我可以直接将我的 sdk 导入其他应用程序并访问其中的所有视图和功能。我怎样才能做到这一点。请建议我在哪里可以找到这个。

0 投票
1 回答
1458 浏览

ios - 使用自定义框架和 Cocoapods 自定义 Xcode 构建配置

我有一个带有主要 iOS 目标的项目、一些源文件在同一个项目中的自定义框架以及 CocoaPods。

我最近更改了我的 Xcode 构建配置名称并添加了两个以涵盖两个环境(暂存、生产)以及每个环境的调试和发布配置。

分期和生产的两个目标

  • MyProduct (Staging)使用默认配置DebugRelease
  • MyProduct (Production)使用默认配置DebugRelease

每次都必须在保存对话框中检查两个目标,这让我非常恼火。我决定只有一个目标,但有多个构建配置。令人惊讶的是,您几乎可以使用 Info.plist 文件中的构建配置和变量来完成所有工作。

每个环境有两个构建配置

所以我改变了这样的配置:

  1. Debug改为Debug Staging
  2. Release改为Release Staging
  3. 我添加了Debug Production
  4. 我添加了Release Production

我也需要更新方案设置以使用正确的配置。

由于您在项目中而不是在单个目标中更改配置,因此所有目标都将获得这些配置。

自定义框架和 CocoaPods 的问题

因为我使用的是 CocoaPods,所以我也跑来pod install为 Pods 生成配置。它成功了,我可以使用不同的配置构建和运行我的主要目标。

现在的问题是我不能再单独构建我的自定义框架,也不能进行单元测试。我收到如下错误:

  • 命令 MergeSwiftModule 失败,退出代码为非零
  • 找不到框架“Pods_MyProject”

从清理派生数据到解构 CocoaPods,我已经尝试过各种方法。

0 投票
3 回答
916 浏览

ios - 如何在 iOS Chart Graph Framework 中设置多种背景颜色

我想在图表视图中设置多种背景颜色。可以在图表视图的背景中设置单一颜色,但无法设置多种颜色。

有关更多详细信息,请检查图像。

百分比要添加背景颜色 0% 到 20% - 红色,21% 到 60% - 白色和 61% 到 100% 的绿色

0 投票
1 回答
116 浏览

ios - 简化运行构建而不是按清洁问题时面临的问题

我创建了一个自定义框架,并使用以下代码为模拟器和 iphone 制作了通用框架

使用以下脚本在设备中安装应用程序时删除不需要的架构

我面临的问题是代码只有在我清理和构建应用程序时才能工作。如果我只是在不清理的情况下构建或运行应用程序,那么它会给我以下错误

Lipo:指定-extract选项时输入文件必须是fat文件 Lipo:无法打开输入文件:frameworks-arm64(没有这样的文件或目录) Rm:frameworks-arm64(没有这样的文件或目录)

0 投票
0 回答
496 浏览

swift5 - Xcode 11.6 在导入自定义框架时出错:使用 Swift 5.3 编译的模块无法由 Swift 5.2.4 导入

Swift 5.2.4 编译器无法导入使用 Swift 5.3 编译的模块:/Users/myMac/Desktop/SampleAdopter_1/SampleAdopter_1/Custom.framework/Modules/Custom.swiftmodule/armv7-apple-ios.swiftmodule

我们正在使用具有 Xcode 12 的 CI Jenkins 构建创建一个自定义框架,并尝试导入另一个使用 Xcode 11.6 的项目并显示上述错误。

我们已经尝试过“build_distribution_flag”——在自定义框架中是的,但我们遇到了同样的错误。我们正在通过在项目中使用 pod 来安装我们的自定义框架。

0 投票
2 回答
2193 浏览

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

我尝试过的事情。

  1. 我尝试完全删除 CryptoSwift 以查看是否由于此 pod 发生错误,但随后崩溃发生在另一个 pod 的 JOSESwift 上。
  2. 我已经意识到崩溃的发生是因为它在 CryptoSwift 和 JOSESwift 中都找不到特定的符号。而且当我使用这些库的特定方法时。

例如,如果我使用 CryptoSwift 的 AES 方法,如果您看到我的框架 repo,通过添加以下代码会发生崩溃,仅包含 pod 不会崩溃,但使用它会导致崩溃。

_$s11CryptoSwift7PaddingO5pkcs7yA2CmFWC

  1. 我还在客户端应用程序中添加 pod,这样如果您看到客户端应用程序 repo,它不会被添加两次,您将看到所有 3 个 pod 都已添加。
0 投票
0 回答
18 浏览

ios-frameworks - 我们如何在 iOS 的自定义框架中嵌入第三方框架

我需要在我的自定义框架中添加一个静态框架。我的自定义框架中有 pod,但由于采用者的依赖问题,我需要添加静态。我收到以下错误。

dyld:库未加载:@rpath/StaticFramework.framework/StaticFramework.framework 引用自:/private/var/containers/Bundle/Application/08DDE5B5-D741-43EC-99FD-EA68FAF9519B/Adopter.app/Frameworks/Custom.framework/自定义原因:找不到图片

这里静态框架添加到自定义框架中,但采用者应用程序面临上述问题。

自定义框架中可能缺少一些所需的设置。