Including binary through Carthage in Xcode 14 results in linker error
sieren opened this issue · 10 comments
Description
When including the most recent (and prior) versions of AppCenter SDK binaries via Carthage, Xcode 14 is unable to link for the iOS simulator.
error build: In [..]/Carthage/Build/iOS//AppCenterAnalytics.framework/AppCenterAnalytics(MSACAnalytics.o), building for iOS Simulator, but linking in object file built for iOS, file '[..]/Carthage/Build/iOS//AppCenterAnalytics.framework/AppCenterAnalytics' for architecture arm64
AFAIK all Carthage does it download the binary and put it in the appropriate folder. So I'm wondering if the issue is the binary here rather than the build tools (Carthage).
This isn't reproducible in Xcode 13.
Repro Steps
Please list the steps used to reproduce your issue.
- Use Carthage and include App Center for the project (
carthage bootstrap --use-xcframeworks --cache-builds --platform iOS
) - Compile and run project
Details
- Which SDK version are you using?
- 4.4.3
- Which OS version did you experience the issue on?
- iOS 15
- Which Xcode version did you build the app with?
- Xcode 14.0 Beta 5
- Which Cocoapods version are you using (run
pod --version
)?- N/A
- What device version did you see this error on? Were you using an emulator or a physical device?
- Simulator
- What language are you using?
- Objective C
- [X ] Swift
- What third party libraries are you using?
- Please enable verbose logging for your app using
MSAppCenter.setLogLevel(.verbose)
before your call toMSAppCenter.start(...)
for Swift, or[MSAppCenter setLogLevel:MSLogLevelVerbose]
before[MSAppCenter start: ...]
for Objective C and include the logs here:
The issue resolves itself when manually replacing the .framework files from Carthage with the .xcframework files from the release binaries. Could be something is off with the Carthage build scripts in this repo?
Hi @sieren , we only have .framework
binaries for Carthage. You can use --use-xcframeworks --no-binaries
to build the xcframeworks locally instead of downloading prebuilt frameworks.
I did try that but the build ultimately failed and I haven't looked into it further (which may be because it was the Xcode beta). I figured this workflow was not supported by the repo/carthage.
I've just tested it myself and it worked for me for Xcode 13 and Xcode 14 (beta 1) projects. Full command I used carthage update --use-xcframeworks --no-use-binaries
.
Can you share your build failure output?
Thank you!
Build command used is:
carthage bootstrap --use-xcframeworks --cache-builds --no-use-binaries --platform iOS
There you go:
Build description signature: a91eff2f6555f95b6bde585d2e238cfa
Build description path: [..]/Library/Caches/org.carthage.CarthageKit/DerivedData/14.0_14A5294e/appcenter-sdk-apple/4.4.3/Build/Intermediates.noindex/ArchiveIntermediates/AppCenter iOS Framework/IntermediateBuildFilesPath/XCBuildData/a91eff2f6555f95b6bde585d2e238cfa-desc.xcbuild
warning: Building targets in manual order is deprecated - choose Dependency Order in scheme settings instead, or set DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING in any of the targets in the current scheme to suppress this warning
[..]/Carthage/Checkouts/appcenter-sdk-apple/AppCenter/AppCenter.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'AppCenter iOS Framework' from project 'AppCenter')
error: The armv7s architecture is deprecated. You should update your ARCHS build setting to remove the armv7s architecture. (in target 'AppCenter iOS Framework' from project 'AppCenter')
warning: Run script build phase 'Verify No Build Settings' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'AppCenter iOS Framework' from project 'AppCenter')
** ARCHIVE FAILED **
Update
Can rule out the --platform iOS param as well, as similar results happen for deprecated platforms for the Mac target:
[...]/Carthage/Checkouts/appcenter-sdk-apple/AppCenterAnalytics/AppCenterAnalytics.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.9, but the range of supported deployment target versions is 10.13 to 13.1. (in target 'AppCenterAnalytics macOS Framework' from project 'AppCenterAnalytics')
warning: Run script build phase 'Verify No Build Settings' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'AppCenterAnalytics macOS Framework' from project 'AppCenterAnalytics')
** ARCHIVE FAILED **
Indeed, the AppCenter SDK is not buildable with Xcode 14 beta now. I'll mark it as a bug.
Thank you!
No updates for this? @DmitriyKirakosyan
I'm getting the same on tag 5.0.0
[...]Carthage/Build/iOS/AppCenterCrashes.framework/AppCenterCrashes(MSACErrorReport.o), building for iOS Simulator, but linking in object file built for iOS, file '[...]/Carthage/Build/iOS/AppCenterCrashes.framework/AppCenterCrashes' for architecture arm64
Hello @alexbartisro, I've tested it with the following command -
carthage update --use-xcframeworks --cache-builds --no-use-binaries --platform iOS
And it's work fine on Xcode 14.2.
Could you please try this command?
@AnatolyPristensky yes, think it looks ok now, thank you!