本文介绍了在 Xcode 12.0 中通过 Carthage 引入 iOS 框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Xcode 12.0 和 Carthage 0.35.0,当我执行 Carthage bootstrap --platform iOSCarthage update --platform iOS --no-use-binaries 在我开发的框架上出现此错误.我在 Xcode 11.7 中没有这个问题.

*** 构建方案MyFrameworkKit";在 MyFrameworkKit.xcodeproj 中构建失败任务失败,退出代码 1:/usr/bin/xcrun lipo -create/Users/myname/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/MyFrameworkKit/579b0a4ac155ab413da1d73609bf5f24e5ed7cciveFramesIntermediesMyPath/DerivedData/DerivedData/12.0_12A7209/MyFrameworkKit/579b0a4ac155ab413da1d73609bf5f24e5ed7cciveFramesIntermediesMyPathed7cciveFrames/.framework/MyFrameworkKit/Users/myname/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/MyFrameworkKit/579b0a4ac155ab413da1d73609bf5f24e5ed7cc8/Rev.myapp/ios/Carthage/Build/iOS/MyFrameworkKit.framework/MyFrameworkKit这通常表示项目本身未能编译.请查看 xcodebuild 日志以获取更多详细信息:/var/folders/11/tjwvq_yx4mj042kv46mxz1wh0000gn/T/carthage-xcodebuild.gaIzr4.log

当我查看上面提到的日志文件时.我看到构建成功了.但是当我打开 Xcode 并尝试构建应用程序时,我看到以下消息:/Users/myname/Developer/myapp/ios/myapp.xcodeproj Building for iOS Simulator,但链接框架MyFrameworkKit.framework"是为构建的iOS.

我可以从 Xcode 11.7 到 Xcode 12.0 将哪种类型的框架构建引入我的应用程序中,肯定发生了一些变化.你知道我错过了什么吗?

更新:

我一直在成功使用下面接受的答案中建议的解决方法.似乎有一个新的 Carthage 版本,我还必须尝试.但它确实说它解决了这个问题:https://github.com/Carthage/Carthage/releases/tag/0.36.1

解决方案

答案很简单:Carthage 0.35.0 与 Xcode 12 不兼容.他们正在修复.在此之前,有一个解决方法.

I am using Xcode 12.0 and Carthage 0.35.0 and when I do Carthage bootstrap --platform iOS or Carthage update --platform iOS --no-use-binaries on a framework that I have developed I get this error. I did not have this problem in Xcode 11.7.


*** Building scheme "MyFrameworkKit" in MyFrameworkKit.xcodeproj
Build Failed
    Task failed with exit code 1:
    /usr/bin/xcrun lipo -create /Users/myname/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/MyFrameworkKit/579b0a4ac155ab413da1d73609bf5f24e5ed7cc8/Build/Intermediates.noindex/ArchiveIntermediates/MyFrameworkKit/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/MyFrameworkKit.framework/MyFrameworkKit /Users/myname/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/MyFrameworkKit/579b0a4ac155ab413da1d73609bf5f24e5ed7cc8/Build/Products/Release-iphonesimulator/MyFrameworkKit.framework/MyFrameworkKit -output /Users/myname/Developer/myapp/ios/Carthage/Build/iOS/MyFrameworkKit.framework/MyFrameworkKit

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/11/tjwvq_yx4mj042kv46mxz1wh0000gn/T/carthage-xcodebuild.gaIzr4.log

When I look at the log file mentioned above. I see that the build the was successful. But when I open Xcode and try to build the app I see the message: /Users/myname/Developer/myapp/ios/myapp.xcodeproj Building for iOS Simulator, but the linked framework 'MyFrameworkKit.framework' was built for iOS.

Something must have changed in what type of framework build I can bring into my app from Xcode 11.7 to Xcode 12.0. Do you know what it is that I am missing?

Update:

I have been using the workaround suggested in the accepted answer below successfully. Seems like there is a new Carthage release that I yet I have to try. But it does say that it fixes this issue:https://github.com/Carthage/Carthage/releases/tag/0.36.1

解决方案

The answer is simple: Carthage 0.35.0 is incompatible with Xcode 12. They are working on a fix. Until then, there is a workaround.

这篇关于在 Xcode 12.0 中通过 Carthage 引入 iOS 框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 22:22