13

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

Dogahe
  • 1,380
  • 2
  • 20
  • 50
  • Does this answer your question? [Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64](https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-object-file-built-for-ios) – shim Sep 18 '20 at 06:04

5 Answers5

12

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.

Nils Hott
  • 1,650
  • 15
  • 16
  • 4
    Thank you! Specifically, [this comment](https://github.com/Carthage/Carthage/issues/3019#issuecomment-665136323) in that discussion that fixed the problem for me. – NRitH Oct 02 '20 at 23:13
3

Now Carthage 0.37 finally is capabable of building XCFrameworks This makes it compatible with Xcode 12 and the workaround can be deleted. Just perform the following steps:

# Delete carthage cache
rm -rf ~/Library/Caches/org.carthage.CarthageKit
# Delete carthage build folder
rm -rf Carthage/Build
# Delete DerivedData folder
rm -rf ~/Library/Developer/Xcode/DerivedData
# Build all dependencies as XCFrameworks
carthage bootstrap --use-ssh --use-xcframeworks --cache-builds

See the Github release 0.37.0 for detailled information and a migration guide from frameworks to XCFrameworks. The guide tells you how to integrate the xcframeworks and what you have to remove from your project.

blackjacx
  • 9,011
  • 7
  • 45
  • 56
1

I used the suggestion here: https://newreleases.io/project/github/Carthage/Carthage/release/0.37.0

Basically: To build XCFrameworks into your app, run Carthage with --use-xcframeworks and drag the produced XCFrameworks into your Xcode target’s Embedded binaries section...

This is the command I used: carthage bootstrap --platform iOS --use-xcframeworks

uudaddy
  • 341
  • 4
  • 9
0

Check if "." is included in framework search paths. if there is delete it.

NSparesh
  • 21
  • 1
  • 1
0

Carthage 0.36.1 still has this bug.

norbDEV
  • 4,795
  • 2
  • 37
  • 28