LoopKit / CGMBLEKit

Make your G5/G6 data truly mobile.
MIT License
139 stars 151 forks source link

Carthage build issue with SwiftCharts package #156

Open weschilders opened 3 years ago

weschilders commented 3 years ago

I've previously been able to build and run the app but I'm getting errors when trying to update carthage. Any tips?

Build Failed Task failed with exit code 1: /usr/bin/xcrun lipo -create /Users/wes/Library/Caches/org.carthage.CarthageKit/DerivedData/12.1_12A7403/SwiftCharts/0.6.5/Build/Intermediates.noindex/ArchiveIntermediates/SwiftCharts/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SwiftCharts.framework/SwiftCharts /Users/wes/Library/Caches/org.carthage.CarthageKit/DerivedData/12.1_12A7403/SwiftCharts/0.6.5/Build/Products/Release-iphonesimulator/SwiftCharts.framework/SwiftCharts -output /Users/wes/Downloads/CGMBLEKit-dev/Carthage/Build/iOS/SwiftCharts.framework/SwiftCharts

esha1701 commented 3 years ago

I am getting the same error...I tried downgrading to Xcode 11 but that didn't work either I think this is the problem - Carthage/Carthage#3019

david-gonzalez-pnw commented 3 years ago

I was running into this issue, specifically the error below

*** xcodebuild output can be found in /var/folders/02/k9c3235n4rgbqm8m78tx2hkh0000gn/T/carthage-xcodebuild.koMK2j.log
*** Building scheme "SwiftCharts" in SwiftCharts.xcodeproj
A shell task (/usr/bin/xcrun lipo -create /Users/user/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/SwiftCharts/0.6.5/Build/Intermediates.noindex/ArchiveIntermediates/SwiftCharts/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SwiftCharts.framework/SwiftCharts /Users/user/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/SwiftCharts/0.6.5/Build/Products/Release-iphonesimulator/SwiftCharts.framework/SwiftCharts -output /Users/user/Downloads/CGMBLEKit-dev/Carthage/Build/iOS/SwiftCharts.framework/SwiftCharts) failed with exit code 1:
fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/user/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/SwiftCharts/0.6.5/Build/Intermediates.noindex/ArchiveIntermediates/SwiftCharts/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SwiftCharts.framework/SwiftCharts and /Users/user/Library/Caches/org.carthage.CarthageKit/DerivedData/12.5_12E262/SwiftCharts/0.6.5/Build/Products/Release-iphonesimulator/SwiftCharts.framework/SwiftCharts have the same architectures (arm64) and can't be in the same fat output file

Building universal frameworks with common architectures is not possible. The device and simulator slices for "SwiftCharts" both build for: arm64
Rebuild with --use-xcframeworks to create an xcframework bundle instead.

I'm on Big Sur, Xcode 12, building to a iOS14 target and the workaround specified in https://github.com/Carthage/Carthage/issues/3019#issuecomment-665136323 helped me solve this issue.

I had been trying to build this for two days and had originally found this post that you referenced @esha1701 but missed that specific comment, I was doing some of the other workarounds. Great find!!

PS: don't use use --use-xcframeworks, that'll send you down a rabbit hole that will lead to other errors that are harder to get to the bottom of. I spent hours on this and it wasn't till I read more about what xcframeworks are and their backstory that I knew I shouldn't be spending time on it.

mrengy commented 2 years ago

I'm having the same error. Here's how I ended up with it.

I followed instructions at https://seemycgm.com/2018/05/03/reset-g5-transmitter/ .

In Xcode, I got the build error the post mentions: Swift Compiler Error > No such module 'LoopKit'

I tried the solution the post suggested: in Terminal, cd downloads/cgmblekit-dev && carthage update .

I then got

Mike-Engs-MacBook-Pro-5:~ mikeeng$ cd downloads/cgmblekit-dev && carthage update Fetching dexcom-share-client-swift Fetching LoopKit Fetching SwiftCharts Checking out LoopKit at "acd1212467ff7f7a3da6ff695f83764bbd0779a4" Checking out dexcom-share-client-swift at "e3eb1b2baee97d95144c3f3f40c77ded42226604" Checking out SwiftCharts at "0.6.5" xcodebuild output can be found in /var/folders/9l/1slnl4q56pz_lc8krfnbdb000000gq/T/carthage-xcodebuild.qUSfBw.log Building scheme "SwiftCharts tvOS" in SwiftCharts.xcodeproj A shell task (/usr/bin/xcrun lipo -create /Users/mikeeng/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/SwiftCharts/0.6.5/Build/Intermediates.noindex/ArchiveIntermediates/SwiftCharts\ tvOS/IntermediateBuildFilesPath/UninstalledProducts/appletvos/SwiftCharts.framework/SwiftCharts /Users/mikeeng/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/SwiftCharts/0.6.5/Build/Products/Release-appletvsimulator/SwiftCharts.framework/SwiftCharts -output /Users/mikeeng/Downloads/CGMBLEKit-dev/Carthage/Build/tvOS/SwiftCharts.framework/SwiftCharts) failed with exit code 1: fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/mikeeng/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/SwiftCharts/0.6.5/Build/Intermediates.noindex/ArchiveIntermediates/SwiftCharts tvOS/IntermediateBuildFilesPath/UninstalledProducts/appletvos/SwiftCharts.framework/SwiftCharts and /Users/mikeeng/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/SwiftCharts/0.6.5/Build/Products/Release-appletvsimulator/SwiftCharts.framework/SwiftCharts have the same architectures (arm64) and can't be in the same fat output file

Building universal frameworks with common architectures is not possible. The device and simulator slices for "SwiftCharts" both build for: arm64 Rebuild with --use-xcframeworks to create an xcframework bundle instead. Mike-Engs-AdHoc-MacBook-Pro-5:cgmblekit-dev mikeeng$ brew upgrade carthage Updating Homebrew... Warning: carthage 0.38.0 already installed Mike-Engs-MacBook-Pro-5:cgmblekit-dev mikeeng$

I tried the workaround @david-gonzalez-pnw linked: https://github.com/Carthage/Carthage/issues/3019#issuecomment-665136323 , which got me a bit farther but ended up with a different error:

Build Failed Task failed with exit code 65: /usr/bin/xcrun xcodebuild -project /Users/mikeeng/Downloads/CGMBLEKit-dev/Carthage/Checkouts/LoopKit/LoopKit.xcodeproj -scheme Shared-watchOS -configuration Release -derivedDataPath /Users/mikeeng/Library/Caches/org.carthage.CarthageKit/DerivedData/12.4_12D4e/LoopKit/acd1212467ff7f7a3da6ff695f83764bbd0779a4 -sdk watchos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive VALIDATE_WORKSPACE=NO -archivePath /var/folders/9l/1slnl4q56pz_lc8krfnbdb000000gq/T/LoopKit SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/mikeeng/Downloads/CGMBLEKit-dev/Carthage/Checkouts/LoopKit)

This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/9l/1slnl4q56pz_lc8krfnbdb000000gq/T/carthage-xcodebuild.mID03E.log

I'm using Xcode 12.4 on Mac OS 10.15.7, building for iOS 12.1

CAMOBAP commented 2 years ago

@mrengy have you tried to use Scripts/carthage.sh update --platform iOS instead carthage update?

Also, I have found that the same problem exists for Xcode 13, so make sense to update Scripts/carthage.sh accordingly https://github.com/ably/ably-cocoa/commit/7506465d1babacc28c9d746220c9eae8eafad92e

Also at this moment Cartfile.resolved looks outdated so make sure to update it with Scripts/carthage.sh update --platform iOS

mrengy commented 2 years ago

Thanks for the info. I haven’t tried that and likely won’t get back to trying again until my next transmitter battery dies in several months.

snackattas commented 2 years ago

@CAMOBAP, I'm chiming in here

@mrengy have you tried to use Scripts/carthage.sh update --platform iOS instead carthage update?

Also, I have found that the same problem exists for Xcode 13, so make sense to update Scripts/carthage.sh accordingly ably/ably-cocoa@7506465

Also at this moment Cartfile.resolved looks outdated so make sure to update it with Scripts/carthage.sh update --platform iOS

Just curious, after running all these carthage commands, is the idea, then you click the play button in xcode and the build issues will have resolved themselves, with the carthage commands?

Also, I made that update to Scripts/carthage.sh, but got another error that the build target was incorrect (my phone is on iOS 14.1). Then I updated it and got another error, described here: https://github.com/LoopKit/CGMBLEKit/issues/165. Any help you have with this is appreciated!