xcodebuild cause fatal error but in Xcode, compilation is OK - xcode

I have a weird thing when I try to compile with xcodebuild.
If I open the project on the mac with XCode, the code compile without any warning.
If I use the following command line :
xcodebuild -configuration Debug -target myApp PROVISIONING_PROFILE=B5AD0E27-B224-4962-B0DC-XXXXXXXX
I have some compilation error :
/Users/myUser/.jenkins/jobs/myApp/workspace/prj/Controllers/DeclarerEtape1Adresse.m:75:6: error: receiver type 'DeclarerEtape1Adresse' for instance message does not declare a method with selector 'rechercheAdresse' [4]
[self rechercheAdresse];
^
1 error generated.
This errors can appear in external code (taken from github). It seems that the compilator is much strict in command line mode than with Xcode.
Is there any specific configuration in command line ?
Thank you for your feedback.

James, you're the boss :p I tried xcodebuild -version on both environment and the ci server used an old SDK 4.2.X. So I used the sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer and it fixes the issue

Related

xcodebuild resolves dependency, but can't import the package

I have a simple command line application, written in swift 5.3, which uses the ArgumentParser package from Apple.
It builds and runs just fine from within Xcode (12.4). However, if I run xcodebuild, as such:
xcodebuild -target mailfilter
It gives this error:
/Users/hacksaw/Documents/src/mailfilter/mailfilter/main.swift:10:8: error: no such module 'ArgumentParser'
import ArgumentParser
^
The relevant project info:
% xcodebuild -list
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -list
Resolve Package Graph
Resolved source packages:
swift-argument-parser: https://github.com/apple/swift-argument-parser # 0.3.2
Information about project "mailfilter":
Targets:
mailfilter
Build Configurations:
Debug
Release
If no build configuration is specified and -scheme is not passed then "Release" is used.
Schemes:
mailfilter
% xcodebuild -version
Xcode 12.4
Build version 12D4e
So, what command line ought I run for it to build correctly?
So the (still unsatisfying) answer to this is indeed that -scheme needs to be included, so this works:
xcodebuild -scheme mailfilter -target mailfilter
An article I read somewhere said something about xcodebuild having a "legacy" mode which is invoked if you don't include a -scheme argument, but didn't go into detail.
I'd love a more complete answer to this, but for now, I'm leaving it.

Golang: Error while make test: signal: killed

I am getting this error while running make test on a Golang project:
signal: killed
FAIL <package name>
make: *** [test] Error 1
The same code was running perfectly fine until yesterday.
Note: I tried doing make test on other branches also but same result.
UPDATE on 04/27/2017:
The new Go1.8.1 (released 2017/04/07) fixed this issue. Please download and install the latest version.
OLD ANSWER:
Mainly the reason was that Command Line Tool 8.3 is not compatible.
According to the solutions from https://github.com/golang/go/issues/19734:
Remove /Library/Developer/CommandLineTools first, download and install Command Line Tool 8.2 from https://developer.apple.com/download/more/?name=Xcode
OR
use -ldflags -s option for compilation or run
Thanks a lot #JimB
I uninstalled the Xcode and it runs fine now. Weird !

error: unable to open executable ''

I just ran into this issue with my Xcode project:
whenever I run it, it says there is the following error GenerateDSYMFile /Users/obleopold/Library/Developer/Xcode/DerivedData/richhh-bzvkjxyolcsbhoffzrtzyohyzhye/Build/Products/Debug-iphoneos/richhh.app.dSYM /Users/obleopold/Library/Developer/Xcode/DerivedData/richhh-bzvkjxyolcsbhoffzrtzyohyzhye/Build/Products/Debug-iphoneos/richhh.app/richhh
cd /Users/obleopold/Documents/richhh
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /Users/obleopold/Library/Developer/Xcode/DerivedData/richhh-bzvkjxyolcsbhoffzrtzyohyzhye/Build/Products/Debug-iphoneos/richhh.app/richhh -o /Users/obleopold/Library/Developer/Xcode/DerivedData/richhh-bzvkjxyolcsbhoffzrtzyohyzhye/Build/Products/Debug-iphoneos/richhh.app.dSYM
The main issue states:
error: unable to open executable ''
Here is some more info:
My project name is: richhh,
my computer username is: obleopold
If you need any more information, please comment.
Go to Product->Clean and then Product->Clean builds(option comes by pressing option button). Delete the derived data, restart Xcode and try running

Building iOS app for iPhone works from xCode but not from command line (xcodebuild)

I am currently trying to streamline our build and release process with an automated build which runs on an OSX server machine , a MacMini running OSX 10.6.7 with xCode 4.0.1 and iOS SDK 4.3 installed (latest release from Apple).
I have followed Mike Nachbaur's excellent guide and it feels like I'm almost there but I still have one final obstacle to overcome.
So. We have our app which build fine on:
a) My laptop from within xCode
b) My laptop from command line with xcodebuild
c) the build machine from within xCode
BUT it does not work on
d) the build machine from the command line with xcodebuild.
Here is the end of the console output:
CreateUniversalBinary build/Distribution-iphoneos/CallControl.app/CallControl normal "armv6 armv7"
cd /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/Users/ainutveckling/Jenkins/tools/jdk6/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/usr/bin/lipo -create /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Callcontrol.build/Distribution-iphoneos/CallControl.build/Objects-normal/armv6/CallControl /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Callcontrol.build/Distribution-iphoneos/CallControl.build/Objects-normal/armv7/CallControl -output /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app/CallControl
GenerateDSYMFile build/Distribution-iphoneos/CallControl.app.dSYM build/Distribution-iphoneos/CallControl.app/CallControl
cd /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/Users/ainutveckling/Jenkins/tools/jdk6/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/usr/bin/dsymutil /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app/CallControl -o /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app.dSYM
ProcessProductPackaging "/Users/ainutveckling/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision
cd /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/Users/ainutveckling/Jenkins/tools/jdk6/bin:/usr/bin:/bin:/usr/sbin:/sbin"
<com.apple.tools.product-pkg-utility> "/Users/ainutveckling/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" -o /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision
** BUILD FAILED **
+ failed build
+ echo 'Failed: build'
Failed: build
+ exit 1
Notifying upstream projects of job completion
Finished: FAILURE
On my machine, it looks almost the same:
GenerateDSYMFile build/Distribution-iphoneos/CallControl.app.dSYM build/Distribution-iphoneos/CallControl.app/CallControl
cd /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/anders/Utveckling/android-sdk-mac_x86/tools:/Users/anders/Utveckling/android-sdk-mac_x86/platform-tools:"
/Developer/usr/bin/dsymutil /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol/build/Distribution-iphoneos/CallControl.app/CallControl -o /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol/build/Distribution-iphoneos/CallControl.app.dSYM
ProcessProductPackaging "/Users/anders/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision
cd /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/anders/Utveckling/android-sdk-mac_x86/tools:/Users/anders/Utveckling/android-sdk-mac_x86/platform-tools:"
<com.apple.tools.product-pkg-utility> "/Users/anders/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" -o /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol/build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision
** BUILD SUCCEEDED **
But success...
It does not matter if I start the build directly from the command line on the build machine or if it is started by Hudson, same result.
The certificate pointed out above seems to be in place.
I'm almost ready to give up on this, so I would very much appreciate any help to shed some light upon the matter!
Best regards,
Anders
I encountered the exact error that you showed above on my build machine after updating to a new distribution certificate and provisioning profile. After the ProcessProductPackaging step, it would just display the ** BUILD FAILED ** message.
However, when running the build manually on the build machine, I encountered the KeyChain permission dialog. Hitting "Allow Always" fixed the problem.
That in addition to unlocking in the build script:
security unlock -p $PASSWORD
Add this line of code to your script:
security list-keychains -s $KEYCHAINFILE
This has fixed the issue for me.

XCode cannot create IPA

My application compiles OK, and verifies.
But each of the Organizer options Validate..., Share..., Submit... just fail silently.
I'm using XCode version 3.2.5
I found the Console application had some information:
30/12/10 13:51:27 Xcode[8458] Running /usr/bin/xcrun with (
"-sdk",
iphoneos,
PackageApplication,
"-v",
"/Users/xxxxxx/Library/Application Support/Developer/Shared/Archived Applications/C201D5C0-2AB4-494B-A560-806AE36EF9A7.apparchive/Xxxxxx.app",
"-o",
"/var/folders/52/528Jj01wGtKYzlqffjXrck+++TI/-Tmp-/0610AAC0-E549-4F07-9496-08EFD6DFCAC3-8458-0000F00C5DE14F9F/Xxxxxx.ipa",
"--sign",
"iPhone Distribution: Xxxxxx",
"--embed",
"/Users/xxxxxx/Library/MobileDevice/Provisioning Profiles/66403280-7962-4A73-92D1-8FF34F65866C.mobileprovision"
)
30/12/10 13:51:27 [0x0-0x439439].com.apple.Xcode[8458] sh: /Developer/usr/bin/xcodebuild: No such file or directory
30/12/10 13:51:27 [0x0-0x439439].com.apple.Xcode[8458] /Developer/usr/bin/xcodebuild fails with 32512 - Unknown error: 32512
After searching around for a while, it appears that my install was missing the directory /Developer/usr/bin/.
In a Terminal shell, I linked the latest XCode version directory:
ln -s /Developer/XCode_3.2.5/usr/ /Developer/usr
and it fixed the problem.
You should try to package your IPA file through command line, so you can have full log in it. Here is a post I wrote, check it out.
http://www.nanaimostudio.com/blog/2011/4/17/xcode-build-and-archive-sharing-problem-and-solution.html

Resources