I am trying to build and archive project to create .ipa via commandline using below command
$ xcodebuild archive -project test.xcodeproj -scheme "Test" -archivePath /build
but it gives below error
** ARCHIVE FAILED **
The following build commands failed:
Ld /Users/user1/Library/Developer/Xcode/DerivedData/test-gymccixkvyhthdhhxixgplbqdrhk/Build/Intermediates/ArchiveIntermediates/Test/IntermediateBuildFilesPath/test.build/Release-iphoneos/Test.build/Objects-normal/arm64/Test normal arm64
Ld /Users/user1/Library/Developer/Xcode/DerivedData/test-gymccixkvyhthdhhxixgplbqdrhk/Build/Intermediates/ArchiveIntermediates/Test/IntermediateBuildFilesPath/test.build/Release-iphoneos/Test.build/Objects-normal/armv7/Test normal armv7
Am I missing something?
We need more information. I suspect however, that /build is not a writeable directory.
For good example of how to build with scripts see this project:
https://github.com/calabash/ios-smoke-test-app/blob/master/CalSmokeApp/Makefile
Related
I am having an ARCHIVE FAILED issue to build flutter project for IOS in my command line with the command
admin#admin-MacBook-Pro myapp-client % /usr/bin/xcodebuild -sdk iphoneos -configuration Release -workspace /Users/admin/Desktop/admin/myapp-client/ios/Runner.xcworkspace -scheme alpha archive -verbose FLUTTER_ROOT=/Users/admin/Desktop/admin/flutter
However, when I click the Achive button in Xcode, it can achive successfully. I got the above command from my Azure DevOps pipeline to build Xcode. I got the same error in Azure DevOps with error code 65 (please see the error log from Azure DevOps at the end of the question).
Both from the Azure DevOps and local command line, I could not tell an obvious error. Can anyone please help? This issue has blocked me to a few weeks but could not get any clue.
Here is a part of build log. Please let me know if you need more. Thank you
Strip /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app/Runner (in target 'Runner' from project 'Runner')
cd /Users/admin/Desktop/admin/myapps-client/ios
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app/Runner
SetOwnerAndGroup admin:staff /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app (in target 'Runner' from project 'Runner')
cd /Users/admin/Desktop/admin/myapps-client/ios
/usr/sbin/chown -RH admin:staff /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app
SetMode u+w,go-w,a+rX /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app (in target 'Runner' from project 'Runner')
cd /Users/admin/Desktop/admin/myapps-client/ios
/bin/chmod -RH u+w,go-w,a+rX /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app
CodeSign /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app (in target 'Runner' from project 'Runner')
cd /Users/admin/Desktop/admin/myapps-client/ios
export CODESIGN_ALLOCATE\=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Signing Identity: "Apple Distribution: Cert (XXXXXX)"
Provisioning Profile: "My_apps_IOS_Distribution"
(Some guid)
/usr/bin/codesign --force --sign SOME IDENTITY --entitlements /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Runner.app.xcent --generate-entitlement-der /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app
ValidateEmbeddedBinary /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app/PlugIns/Share\ Extension.appex (in target 'Runner' from project 'Runner')
cd /Users/admin/Desktop/admin/myapps-client/ios
/Applications/Xcode.app/Contents/Developer/usr/bin/embeddedBinaryValidationUtility /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app/PlugIns/Share\ Extension.appex -signing-cert SOME IDENTITY -info-plist-path /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app/Info.plist
warning: The CFBundleVersion of an app extension ('1') must match that of its containing parent app ('3261').
RegisterExecutionPolicyException /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app (in target 'Runner' from project 'Runner')
cd /Users/admin/Desktop/admin/myapps-client/ios
builtin-RegisterExecutionPolicyException /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app
Validate /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app (in target 'Runner' from project 'Runner')
cd /Users/admin/Desktop/admin/myapps-client/ios
builtin-validationUtility /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app
Touch /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app (in target 'Runner' from project 'Runner')
cd /Users/admin/Desktop/admin/myapps-client/ios
/usr/bin/touch -c /Users/admin/Library/Developer/Xcode/DerivedData/Runner-azykwrtawkhtxmcscwjshiptxdjw/Build/Intermediates.noindex/ArchiveIntermediates/alpha/InstallationBuildProductsLocation/Applications/Runner.app
** ARCHIVE FAILED **
The following build commands failed:
Run custom shell script 'Run Script'
(1 failure)
In Azure DevOps, I tried to rerun the previously passed build (about a week ago). For the first try, I got the follow error
ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1316.0.21.2.5_0' Reader: '1300.0.29.30_0')', using libLTO version 'LLVM version 13.0.0, (clang-1300.0.29.30)' for architecture arm64
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
** ARCHIVE FAILED **
Then I set Enable Bitcode of the Target to No. After that, these errors were fixed and got a different error. Here is a part of the log from Azure DevOps.
Compiling AppDelegate.swift
▸ Copying /Users/runner/Library/Developer/Xcode/DerivedData/Runner-gsjhxdjmxuzkkbgjdidjocbaqrkc/Build/Intermediates.noindex/ArchiveIntermediates/alpha/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Objects-normal/arm64/Runner-Swift.h
▸ Copying /Users/runner/Library/Developer/Xcode/DerivedData/Runner-gsjhxdjmxuzkkbgjdidjocbaqrkc/Build/Intermediates.noindex/ArchiveIntermediates/alpha/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Objects-normal/arm64/Runner.swiftdoc
▸ Copying /Users/runner/Library/Developer/Xcode/DerivedData/Runner-gsjhxdjmxuzkkbgjdidjocbaqrkc/Build/Intermediates.noindex/ArchiveIntermediates/alpha/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Objects-normal/arm64/Runner.swiftdoc
▸ Copying /Users/runner/Library/Developer/Xcode/DerivedData/Runner-gsjhxdjmxuzkkbgjdidjocbaqrkc/Build/Intermediates.noindex/ArchiveIntermediates/alpha/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Objects-normal/arm64/Runner.swiftmodule
▸ Copying /Users/runner/Library/Developer/Xcode/DerivedData/Runner-gsjhxdjmxuzkkbgjdidjocbaqrkc/Build/Intermediates.noindex/ArchiveIntermediates/alpha/IntermediateBuildFilesPath/Runner.build/Release-iphoneos/Runner.build/Objects-normal/arm64/Runner.swiftmodule
▸ Compiling Runner_vers.c
▸ Compiling GeneratedPluginRegistrant.m
▸ Linking Runner
⚠️ ld: method '-mdm_reversed' in category from /Users/runner/work/1/s/ios/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/GoogleMapsBase conflicts with same method from another category
⚠️ ld: method '-mdm_point1' in category from /Users/runner/work/1/s/ios/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/GoogleMapsBase conflicts with same method from another category
⚠️ ld: method '-mdm_point2' in category from /Users/runner/work/1/s/ios/Pods/GoogleMaps/Base/Frameworks/GoogleMapsBase.framework/GoogleMapsBase conflicts with same method from another category
▸ Copying GoogleService-Info.plist
▸ Copying AppFrameworkInfo.plist
▸ Compiling Main.storyboard
▸ Compiling LaunchScreen.storyboard
▸ Processing Info.plist
▸ Running script 'Thin Binary'
▸ Generating 'Runner.app.dSYM'
▸ Running script '[CP] Embed Pods Frameworks'
▸ Running script 'Run Script'
▸ Running script '[CP] Copy Pods Resources'
▸ Copying /Users/runner/Library/Developer/Xcode/DerivedData/Runner-gsjhxdjmxuzkkbgjdidjocbaqrkc/Build/Intermediates.noindex/ArchiveIntermediates/alpha/BuildProductsPath/Release-iphoneos/Share\ Extension.appex
The CFBundleVersion of an app extension ('1') must match that of its containing parent app ('3287').
▸ Touching Runner.app (in target 'Runner' from project 'Runner')
** ARCHIVE FAILED **
The following build commands failed:
Run custom shell script 'Run Script'
(1 failure)
##[error]Error: /usr/bin/xcodebuild failed with return code: 65
I installed a new cocoa pod (LaunchDarkly) for my Xcode project, but I'm getting the following error in my CI server when trying to build the project:
⚠️ ld: directory not found for option '-F/Users/runner/Library/Developer/Xcode/DerivedData/ProjectName-hlaqakonueydmsgzoxgekwjpjyds/Build/Products/Debug-iphonesimulator/LDSwiftEventSource'
⚠️ ld: directory not found for option '-F/Users/runner/Library/Developer/Xcode/DerivedData/ProjectName-hlaqakonueydmsgzoxgekwjpjyds/Build/Products/Debug-iphonesimulator/LaunchDarkly'
❌ ld: framework not found LDSwiftEventSource
❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
How do I fix this?
I realized the issue was that I was still building the .xcodeproj file as shown below:
xcodebuild build-for-testing
-project ProjectName.xcodeproj
-scheme ProjectName
-destination 'platform=iOS Simulator,name=iPhone 12,OS=latest'
-testPlan UnitTests
| xcpretty
But since I was now using cocoa pods in my project, I needed to use the .xcworkspace file to build it:
xcodebuild build-for-testing
-workspace ProjectName.xcworkspace
-scheme ProjectName
-destination 'platform=iOS Simulator,name=iPhone 12,OS=latest'
-testPlan UnitTests
| xcpretty
I know this question has been asked before, but none of the solutions provided out there worked for me.
I've cloned nextcloud-ios app, where dependancies are managed with carthage. When I try to build the realm-cocoa dependancy with carthage build realm-cocoa --platform ios --no-use-binaries --cache-builds I got build failed message:
*** No cache found for realm-cocoa, building with all downstream dependencies
*** xcodebuild output can be found in /var/folders/60/rmt9jlwd01l3h3srvjnx7r7w0000gn/T/carthage-xcodebuild.u6zLJP.log
*** Building scheme "Realm" in Realm.xcworkspace
*** Building scheme "RealmSwift" in Realm.xcworkspace
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -workspace /Users/manishkungwani/repos/brilcloud-ios/Carthage/Checkouts/realm-cocoa/Carthage/Realm.xcworkspace -scheme RealmSwift -configuration Release -derivedDataPath /Users/manishkungwani/Library/Caches/org.carthage.CarthageKit/DerivedData/10.3_10G8/realm-cocoa/v3.13.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/60/rmt9jlwd01l3h3srvjnx7r7w0000gn/T/realm-cocoa SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/manishkungwani/repos/brilcloud-ios/Carthage/Checkouts/realm-cocoa)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/60/rmt9jlwd01l3h3srvjnx7r7w0000gn/T/carthage-xcodebuild.u6zLJP.log
I've two version of xcode on my system: 11.4 and 10.3, and tried every possible solutions like this, tried switching command line tools to xcode 10.3, but no luck. Please help.
I'm trying to compile VLCKit on Mac OS 10.9 following this wiki : https://wiki.videolan.org/VLCKit/
I have clone git://git.videolan.org/vlc-bindings/VLCKit.git
then open VLCKit.xcodeproj in Xcode 5.1
and finally run "Build Everything".
But build failed with thoses issues :
Run VLC configure
PhaseScriptExecution bootstrap /Users/myname/Library/Developer/Xcode/DerivedData/VLCKit- bktcaifqrsqwbodqlfdqgsmkkdeb/Build/Intermediates/VLCKit.build/Debug/Run\ VLC\ configure.build/Script-631A90420D5A007D0014A2CE.sh
cd /Users/myname/Documents/PhcDev/VLCKit
/bin/sh -c \"/Users/myname/Library/Developer/Xcode/DerivedData/VLCKit- bktcaifqrsqwbodqlfdqgsmkkdeb/Build/Intermediates/VLCKit.build/Debug/Run\ VLC\ configure.build/Script-631A90420D5A007D0014A2CE.sh\"
/Users/myname/Library/Developer/Xcode/DerivedData/VLCKit-bktcaifqrsqwbodqlfdqgsmkkdeb/Build/Intermediates/VLCKit.build/Debug/Run VLC configure.build/Script-631A90420D5A007D0014A2CE.sh: line 16: ./bootstrap: No such file or directory
Setup VLC contribs
PhaseScriptExecution make /Users/myname/Library/Developer/Xcode/DerivedData/VLCKit-bktcaifqrsqwbodqlfdqgsmkkdeb/Build/Intermediates/VLCKit.build/Debug/Setup\ VLC\ contribs.build/Script-633BD6E30D2ADF030012A314.sh
cd /Users/myname/Documents/PhcDev/VLCKit
/bin/sh -c \"/Users/myname/Library/Developer/Xcode/DerivedData/VLCKit-bktcaifqrsqwbodqlfdqgsmkkdeb/Build/Intermediates/VLCKit.build/Debug/Setup\ VLC\ contribs.build/Script-633BD6E30D2ADF030012A314.sh\"
Building tools
/Users/myname/Library/Developer/Xcode/DerivedData/VLCKit-bktcaifqrsqwbodqlfdqgsmkkdeb/Build/Intermediates/VLCKit.build/Debug/Setup VLC contribs.build/Script-633BD6E30D2ADF030012A314.sh: line 10: cd: /Users/myname/Documents/PhcDev/VLCKit/vlc-unstable/extras/tools: No such file or directory
/Users/myname/Library/Developer/Xcode/DerivedData/VLCKit-bktcaifqrsqwbodqlfdqgsmkkdeb/Build/Intermediates/VLCKit.build/Debug/Setup VLC contribs.build/Script-633BD6E30D2ADF030012A314.sh: line 11: ./bootstrap: No such file or directory
xcodebuild -project VLCKit.xcodeproj -target "Build Everything"
make: *** [build/Debug/VLCKit.framework] Interrupt: 2
Building a set of contribs for x86_64...
/Users/myname/Library/Developer/Xcode/DerivedData/VLCKit-bktcaifqrsqwbodqlfdqgsmkkdeb/Build/Intermediates/VLCKit.build/Debug/Setup VLC contribs.build/Script-633BD6E30D2ADF030012A314.sh: line 20: cd: /Users/myname/Documents/PhcDev/VLCKit/vlc-unstable/contrib: No such file or directory
Making contribs for x86_64
/Users/myname/Library/Developer/Xcode/DerivedData/VLCKit- bktcaifqrsqwbodqlfdqgsmkkdeb/Build/Intermediates/VLCKit.build/Debug/Setup VLC contribs.build/Script-633BD6E30D2ADF030012A314.sh: line 32: ../bootstrap: No such file or directory
make: *** No rule to make target `prebuilt'. Stop.
Did I miss something ? Can someone help please ?
I finally solved my issues by myself.
Here's what I had to do to make it compile successfully :
Clone project
git clone git://git.videolan.org/vlc-bindings/VLCKit.git
Modify xcode project
open VLCKit.xcodeproj
In Project VLCKit change OS X Deployement Target to “10.9”
In Build Settings change Architectures to “64-bit Intel (x86_64)“
Find and replace NS_DESIGNATED_INITIALIZER (available in xcode 6) by __attribute((objc_designated_initializer))
Close xcode and go back to the terminal
Change compiler
export CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
export CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
export OBJC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
Cleanup
rm -fr ./vlc-unstable/contrib/x86_64-apple-darwin10
Build Release
xcodebuild -project VLCKit.xcodeproj -verbose -target "Fetch libvlc"
xcodebuild -project VLCKit.xcodeproj -verbose -target "Setup VLC contribs" -configuration Release
export PATH=$PWD/vlc-unstable/extras/tools/build/bin:$PATH
cd vlc-unstable
./bootstrap
cd ..
xcodebuild -project VLCKit.xcodeproj -verbose -target "Run VLC configure" -configuration Release
xcodebuild -project VLCKit.xcodeproj -verbose -target "Make VLC" -configuration Release
xcodebuild -project VLCKit.xcodeproj -verbose -target "Build just VLCKit" -configuration Release
cd ./build/Release/
Hope this can help.
Error information:
clang: error: invalid architecture 'arm' for deployment target '-mios-simulator-version-min=4.3'
What's the different between command xcodebuild and Product-->Build?