[Bug]: Xcodebuild archive failed
Nikirama opened this issue · comments
What happened?
I'm trying to archive the app and get .ipa file through xcodebuild
xcodebuild archive -scheme <scheme> -configuration Debug -destination 'generic/platform=iOS' -archivePath <archive>.xcarchive DEVELOPMENT_TEAM=XXXXXX CODE_SIGN_IDENTITY="Apple Development"
But get an error:
`** ARCHIVE FAILED **
The following build commands failed:
CompileC /Users/user/Library/Developer/Xcode/DerivedData/-bdubyjvfyptbdeckosaeycnsyvom/Build/Intermediates.noindex/ArchiveIntermediates//IntermediateBuildFilesPath/.build/Debug-iphoneos/.build/Objects-normal/arm64/OneSignalPush.o /Users/user/PhpstormProjects/igms_mobile_app/output/platforms/ios//Plugins/onesignal-cordova-plugin/OneSignalPush.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target '' from project '')
(1 failure)`
The error occures only using Xcodebuild, from Xcode directly it gets built fine with steps:
- Open the project
- Set Product -> Destination to "Any iOS device (arm64)"
- Run Product -> Archive
Steps to reproduce?
1. Create a cordova project
2. Run cordova plugin add onesignal-cordova-plugin
3. Run cordova platform add ios
4. Go to platforms/ios
5. Run pod install
6. Run xcodebuild archive -scheme <scheme> -configuration Debug -destination 'generic/platform=iOS' -archivePath <archive>.xcarchive DEVELOPMENT_TEAM=XXXXXX CODE_SIGN_IDENTITY="Apple Development"
Steps I tried to solve it:
1. After **cordova plugin add onesignal-cordova-plugin** I see a warning
[!] The `<project> [Debug]` target overrides the `LD_RUNPATH_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-<project>/Pods-<project>.debug.xcconfig'. This can lead to problems with the CocoaPods installation
I've added "$(inherited)" in LD_RUNPATH_SEARCH_PATHS manually and ran pod install again. The warning disappeared
2. Tried other OneSignal versions - 3.x and 2.x
3. Pod reinstall, update repo and setup
What did you expect to happen?
I expect to get .xarchive as a result
OneSignal Cordova SDK version
5.0.4
Which platform(s) are affected?
- iOS
- Android
Relevant log output
Cordova: 12.0.0 (cordova-lib@12.0.1)
Cordova-ios: 7.0.0
Cocoapods: 1.14.3
Xcode: 14.3.1 (Build version 14E300c)
Code of Conduct
- I agree to follow this project's Code of Conduct