I am baffled about this error since I installed xcode 4.2 from xcode 3.2 and switched back to xcode 3.2 Since then I am not able to build for device for any of my projects for any configurations.
The error shown is:
CodeSign build/Debug-iphoneos/MyProject.app cd
"/Users/macadmin/Documents/iPhoneProjectDocs/Madhup/Test/Test
Development/MyProject" setenv PATH
"/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv _CODESIGN_ALLOCATE_
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
/usr/bin/codesign -f -s "iPhone Developer: Madhup (MW9495NA8W)"
"--resource-rules=/Users/macadmin/Documents/iPhoneProjectDocs/Madhup/Test/Test
Development/MyProject/build/Debug-iphoneos/MyProject.app/ResourceRules.plist"
--entitlements "/Users/macadmin/Documents/iPhoneProjectDocs/Madhup/Test/Test
Development/MyProject/build/MyProject.build/Debug-iphoneos/MyProject.build/MyProject.xcent"
"/Users/macadmin/Documents/iPhoneProjectDocs/Madhup/Test/Test
Development/MyProject/build/Debug-iphoneos/MyProject.app"
/Users/macadmin/Documents/iPhoneProjectDocs/Madhup/Test/Test
Development/MyProject/build/Debug-iphoneos/MyProject.app: object
file format invalid or unsuitable Command /usr/bin/codesign failed
with exit code 1
The things I have tried to get over this are:
Completely removed all provisioning profiles and certificates and re-install them.
Change configurations (Debug to some other)
Completely uninstall and re-install xcode
Moreover if I try to build my project from some other systems with same provisioning profile, developer certificate and same build configuration I don't face any problem.
Please help me out as I am so frustrated and thinking of OS re-install :(
So to clarify, you've removed xcode with...
sudo /Developer/Library/uninstall-devtools –mode=all
Have you also cleaned the build (Product menu -> Clean)? I know this sounds a bit of an obvious one - but lots of people forget to do it!
Related
I get this error when tying to run an app on a device with Xcode 5
here is the full error
CodeSign /Users/Nevo/Library/Developer/Xcode/DerivedData/RecipesBook-efcrcmgnkaitsqaxahtumfbdxtmb/Build/Products/Debug-iphoneos/RecipesBook.app
cd "/Users/Nevo/Desktop/RecipesBook for ios 7 and 6"
setenv CODESIGN_ALLOCATE "/Applications/Xcode 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate"
setenv PATH "/Applications/Xcode 2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode 2.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
Using code signing identity "iPhone Distribution: Shay Shalev (QN94KCWC64)" and provisioning profile "ProfileRecipeBook" (52D189D8-2FFD-4939-A3C6-1CD1F8B645E0)
codesign --force --sign 4F0E5397A87B47EE07EC3288681661CBCBB4781C --resource-rules=/Users/Nevo/Library/Developer/Xcode/DerivedData/RecipesBook-efcrcmgnkaitsqaxahtumfbdxtmb/Build/Products/Debug-iphoneos/RecipesBook.app/ResourceRules.plist --entitlements /Users/Nevo/Library/Developer/Xcode/DerivedData/RecipesBook-efcrcmgnkaitsqaxahtumfbdxtmb/Build/Intermediates/RecipesBook.build/Debug-iphoneos/RecipesBook.build/RecipesBook.xcent /Users/Nevo/Library/Developer/Xcode/DerivedData/RecipesBook-efcrcmgnkaitsqaxahtumfbdxtmb/Build/Products/Debug-iphoneos/RecipesBook.app
error: can't exec 'codesign' (No such file or directory)
I copied codesign from /usr/bin/
to:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
and it worked for me.
Solved my problem, thanks for the help. The issue was with my path. I had set my path via /etc/launchd.conf and I was driving myself insane trying to edit my path via ~/.bashrc etc. Make sure /usr/bin is in the path that xcode picks up. This page reminded me:
http://overwatering.org/blog/2012/08/setting-path-osx-mountain-lion/
I'm a newb with cpp so I am sure that this solution won't work for everyone and I am sure there are many reasons not to do this in certain situations.
My solution was to disable signing:
Build settings >> Signing >> Code Signing Identity >> set this to "Don't Code Sign"
I have such a problem.
I used Xcode 3.2.5 earlier then I have installed 4.1 Xcode into Developer folder, so my Xcode 3.2.5 was automatically removed to Xcode 3.2.5 folder. So I was a happy iOs developer with 2 Xcodes. But then I decided to install Xcode 4.2( into Developer folder too). First time no any Xcode could be launched. After reboot everything became ok. Except this:
CodeSign build/Debug-iphoneos/MyTest.app
cd /Users/alexslabinsky/Desktop/MyTest
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv _CODESIGN_ALLOCATE_ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
/usr/bin/codesign -f -s "iPhone Developer: Alex Slabinsky (NUMBERS_here)" --resource-rules=/Users/alexslabinsky/Desktop/MyTest/build/Debug-iphoneos/MyTest.app/ResourceRules.plist --entitlements /Users/alexslabinsky/Desktop/MyTest/build/MyTest.build/Debug-iphoneos/MyTest.build/MyTest.xcent /Users/alexslabinsky/Desktop/MyTest/build/Debug-iphoneos/MyTest.app
/Users/alexslabinsky/Desktop/MyTest/build/Debug-iphoneos/MyTest.app: object file format invalid or unsuitable
Command /usr/bin/codesign failed with exit code 1
I tried almost all what could find here and by Google.com but nothing helps. Please, help me. Thanks.
I've personally had upgrade issues several times in relation to using XCode 4.x, where the only thing that solved my problems was to completely uninstall the existing Dev Tools, reboot, and then install the new ones. Uninstall is done via:
sudo <Xcode>/Library/uninstall-devtools --mode=all
When I am building my project, I am getting this error:
CodeSign "build/Debug-iphoneos/MyApp.app"
cd /Users/crackers/Desktop/MyApp/MyApp
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv _CODESIGN_ALLOCATE_ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
/usr/bin/codesign -f -s "iPhone Developer: xxxxxxx xxxxxxxx (D492H27WDR)" "--resource-rules=/Users/crackers/Desktop/MyApp/MyApp/build/Debug-iphoneos/MyApp.app/ResourceRules.plist" --entitlements "/Users/crackers/Desktop/MyApp/MyApp/build/MyApp.build/Debug-iphoneos/MyApp.build/MyApp.xcent" "/Users/crackers/Desktop/MyApp/MyApp/build/Debug-iphoneos/MyApp.app"
/Users/crackers/Desktop/MyApp/MyApp/build/Debug-iphoneos/MyApp.app: object file format invalid or unsuitable
Command /usr/bin/codesign failed with exit code 1
I have both Xcode3.x and Xcode4.x (iOS5 beta) installed in my mac.
Few week ago everything was working fine. All certificates was working fine.
All certificates are in good state.
I had moved the Xcode(s) files to new directory. After that I am getting this error.
If you moved the Xcode files to a new directory and you get this error after you did that, then obviously you should reinstall Xcode in the proper Developer location which is the default. Im running the iOS 5 Beta Xcode and it works fine in the proper directory. First completely uninstall Xcode following a tutorial from the web like this: http://macdevelopertips.com/xcode/how-to-uninstall-xcode.html
Then reinstall Xcode in the proper place, let me know if this works. IMHO it should work though.
i get message during archive validation. i've tried most of solutions from other questions. but still failed. (It was ok when i submit it last time in xcode 4.02, then i get rejected. i edited some image and .m file(not project settings).
my project Build settings:
Architectures->standard (armv7) - $(ARCH_STANDARD_32_BIT)
Base sdk->Latest ios(ios 5.0)
valid Architectures armv6 armv7 arvm7f armv7k
Build active architecture only->no
ios deployment target: ios3.0
i've tried reinstalling xcode and make sure unix is checked, 5 times.
i've tried install back to xcode 4.02, but the same message as xcode 4.2
i've tried reinstall cocos2d
i've tried to set the llvm/gcc to gcc only
warning message 1:
Project Clean-Up Outdated settings should be updated.
when i click it. one is to set gcc to llve-gcc, another is to 'Enable compiler warning for missing Function Prototypes. ' I clicked cancel
warning message 2:
Check dependencies
[BWARN]warning: iPhone apps with a deployment target lower than 4.3 should include an armv6 architecture (current IPHONEOS_DEPLOYMENT_TARGET = "4.1", ARCHS = "armv7").
warning 3:
Validate /Users/lifesucks/Library/Developer/Xcode/DerivedData/FishvsBirdsLite-frctqlpldaogcjebgvxkvvmsehie/ArchiveIntermediates/FishvsBirdsLite/InstallationBuildProductsLocation/Applications/FishvsBirdsLite.app
cd "/Users/lifesucks/my app/Fish vs Birds/FishvsBirdsLite"
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv PRODUCT_TYPE com.apple.product-type.application
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation /Users/lifesucks/Library/Developer/Xcode/DerivedData/FishvsBirdsLite-frctqlpldaogcjebgvxkvvmsehie/ArchiveIntermediates/FishvsBirdsLite/InstallationBuildProductsLocation/Applications/FishvsBirdsLite.app
2011-06-14 01:30:10.948 Validation[8609:607] *** Warning: Defaulting to the standard codesign tool
warning: iPhone/iPod Touch: application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv6 (-19033)
Unable to validate your application. - (null)
warning: There is no codesign_wrapper executable. Please reinstall the Xcode developer tools. (-19058)
Unable to validate your application. - (null)
the error message in organizer is:
the archive is invalid. /var/folders/H5/.../app.ipa does not exist.
I actually don't know why, but it works now. I reinstall back to xcode 4.0.2. then recreated a project, copied over all my classes. i assume that the problem is 'Architectures->standard (armv7)', in xcode 4.0.2 the Architectures is standard armv6/armv7, maybe it's because of cocos2d compatibility to the new version i don't know. anyway if you encounter the same problem, just install back to non-beta and create a new project (since the original setting of 'Architecture' will be modified to 'armv7 standard'. ) hope it helps.
This happened to me when I updated to Xcode 4.2. I went back to the latest non-Beta Xcode version to fix it. The key is, when uninstalling Xcode, you must do it via the following command in Terminal:
sudo /Developer/Library/uninstall-devtools –mode=all
This takes a few minutes. But when it's done, install the non-Beta Xcode (4.0.2 at this time), and then RESTART before using it. Worked for me.
Remove iphoneossimulator from supported platforms for the distribution/release build configuration. That is if you have it.
You cannot have that for distribution, it is only for your debug configurations.
Check the image below for distribution configuration (ignore release config).
I select "Build to Archive" in XCode 4.2, and the following error appears:
Validate "/Users/merlin/Motivapps/DerivedData/GoalWorkshop2-gzesusxljzqjkmbznfkkmylstlca/ArchiveIntermediates/GoalWorkshop2/InstallationBuildProductsLocation/Applications/Goal Wshop.app"
cd /Users/merlin/Motivapps/GoalWorkshop2
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
setenv PRODUCT_TYPE com.apple.product-type.application
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation "/Users/merlin/Motivapps/DerivedData/GoalWorkshop2-gzesusxljzqjkmbznfkkmylstlca/ArchiveIntermediates/GoalWorkshop2/InstallationBuildProductsLocation/Applications/Goal Wshop.app"
2011-06-10 17:10:48.879 Validation[15683:607] *** Warning: Defaulting to the standard codesign tool
warning: There is no codesign_wrapper executable. Please reinstall the Xcode developer tools. (-19058)
Unable to validate your application. - (null)
The same configuration worked well with previous XCode, and I just double checked - code sign certificates are valid. Suggestions?
Just change your selected Xcode version like this:
$ xcode-select -print-path
/Xcode42
$ sudo xcode-select -switch /Xcode402
Password:
$ xcode-select -print-path
/Xcode402
The only solution I found was to remove XCode 4.2beta from the system, and reinstall the previous version - it helped. Beta versions are not meant to build release builds I guess.