"The codesign tool could not be found" from Xamarin Studio - ios

I'm trying to generate an IPA file for my App from Xamarin Studio, on Mac, and i'm getting this error:
"The codesign tool could not be found"
I checked the certificates, provisioning profiles, etc. I generated apps before in this machine, using the same developer account.
From Terminal i can see that codesign command is being recognized, but maybe Xamarin Studio is looking for it in a different place.
Similar problem in XCode
I tried to generate the IPA from a random project in XCode and it gave me a similar error:
"can't exec 'codesign'"
Then i found an issue on stackoverflow that said to copy the codesign program from /usr/bin to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/u‌​sr/bin
I did that and everything worked fine in XCode, but still getting the same error from Xamarin Studio.
Any ideas?
Thanks in advance!

I don't know anything about xamarin, but chances are you don't have command line tools installed. Go to preferences and downloads. I think it comes standard with Xcode 5 now, but maybe not.

Since i was totally out of time, and needed a workaround, i reinstalled the OS and all the tools, and it did the job for me.
I'm sorry i couldn't get to a more concrete solution for this problem.

Related

Xamarin.iOS build archiving error "Could not find a part of the path '.../Frameworks'"

I am trying archive Xamarin.iOS build by press "Archive for Publishing" at Visual Studio for Mac. I get error "Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1431,3): error : Could not find a part of the path '/Users/[username]/Projects/[projectname]/[projectname]/[projectname]/[projectname].iOS/bin/iPhone/Release/[projectname].iOS.app/Frameworks'."
What is wrong?
P.S. Xamarin.Forms 5.0.0.1931, Xamarin.iOS 14.14.1.0
I have exactly the same problem: Rebuilding works perfectly with no errors but archiving iOS does not and shows the same error message.
I tried cleaning up the solution, removing bin folders and Mac cache, reinstalling the Apple certificates and provisioning profiles (no error there)... but I am still getting this exact issue.

can't build for adhoc distribution appcelerator

I`m having lots of trouble with this one. I tried compiling an app for adhoc distribution and started with this error:
Failed to export archive to ipa
[ERROR] : The selected provisioning profile "" is most likely not a valid Ad Hoc provisioning profile.
[ERROR] : Please ensure you are using a valid Ad Hoc provisioning that is linked to the signing identity, then try again.
I "solved that part" running appc run -p ios -T dist-adhocthrough console line, but then I got
Cannot find module '/Users/ggomez22/Documents/Appcelerator_Studio_Workspace/MODI-Express-Dashboard/undefined'
[ERROR] Alloy compiler failed
also solved that one running sudo npm install alloy -g which also resulted in an error related to my defaultIcon.png (solved that) but now I'm stuck with
Session invalid. Please log in again.
I already tried logging in and out several times but the problem persists, I also tried with appc logout -D and had to use the code sent to my email to log in again but that didn't solve the problem either.
I need help with this. Thank you.
I will advise you to download Appc Studio & setup everything there. It looks like you are trying things piece by piece. Solve one & move to other problem. so it's better to avoid this tedious process & use Appc Studio IDE to build your project.
It's merely of 400MB & everything should be working fine.
Studio can also report you errors if there are any other because you can't be sure what's stopping you from building app from command line.
Looking at that Session Invalid issue, I used to solve it using appc login without logout as it refreshes the tokens & necessary things.

"No code signing identities found" error building cordova app for iOS device

I am trying to build a cordova app for iOS here on my Mac, and I am plagued by the "No codesigning identities found" error. Based on other posts, the frequent resolutions include stopping and restarting Xcode and rebooting, and redownloading the provisioning profile. None of that has worked for me.
It is odd because I reference the provisioning profile by GUID in my build.json, but the error mentions the profile by name. This indicates to me that something somewhere is successfully locating the profile. So I am not sure why it isn't able to use it.
I get the error when I build at the command line using:
cordova build ios --device --buildConfig="build.json"
I would think I should be able to reproduce the issue by building in Xcode, but when I load the cordova project in Xcode and build it, it seems to be fine. But perhaps I am not doing the equivalent step in Xcode. I am just choosing to "Build" in Xcode. Perhaps there is another way to do the equivalent in Xcode?
This same codebase does build successfully on our build box, so this is undoubtedly a config issue here on my Mac. What do I need to do besides download and install the provisioning profile? I have done this both by downloading from Apple Developer and by directly installing through the Xcode preferences.
Below is the exact error I am getting:
Code Sign error: No codesigning identities found: No codesigning identities (i.e. certificate and private key pairs) that match the provisioning profile specified in your build settings (“[the name of our profile]”) were found.
I am a relative novice building an app developed by someone else. I have tried everything near the top of the Google search results for this error, but not much else. I am likely missing something obvious. Pointers and help would be greatly appreciated.
I had not installed the Enterprise distribution certificate with the private key here on my Mac. Once I did that it worked.

Xcode's Bot always returns error

I got an issue with Xcode's Bot. It always returns the "User canceled the operation. Command /usr/bin/codesign failed with exit code 1" error string after running the command below:
/usr/bin/codesign --force --sign <MY_PRIVATE_KEY> --entitlements /Library/Developer/XcodeServer/Integrations/Caches/2cdd321641e8c114e4eba9819b017479/DerivedData/Build/Intermediates/MyApp.build/Debug-iphoneos/MyApp.build/MyApp.app.xcent /Library/Developer/XcodeServer/Integrations/Caches/2cdd321641e8c114e4eba9819b017479/DerivedData/Build/Products/Debug-iphoneos/MyApp.app
I can run this command in Terminal with sudo. I'm using Xcode 6.3.1 and OS X Server 4.1.53 in my Mac 10.10.4.
Thank for your help.
This looks like a code signing error. There are a few different reasons for this to happen so you will need to do some troubleshooting. Can other bots build on your server? If so then its probably a build settings issue in this specific project.
In the Xcode Project go to the Project Target that your trying to build, and then Build Settings, and Code Signing. Under the Provisioning Profile you can either choose Automatic or explicitly choose the correct provision, and then under the Code Signing Identity choose iOS Developer. This is probably where your issue is if its related to the project. Do you have a proper provision setup for the project on the Apple Developer Portal?
If you can't get any bots to run on your server then the issue could be with how you set up Xcode Server. Have you added the server to your team? Here is the blog post that I used to get mine up and running, although you don't need to do all of those steps in the post. Focus specifically on the Setup Certificates section and Setup Provisioning Profiles section.
I fixed the issue by copying the missing provisioning file from my local directory "/Users/phuongle/Library/MobileDevice/Provisioning Profiles" to "/Library/Developer/XcodeServer/ProvisioningProfiles". Do not use the downloaded provisioning file from developer.apple.com directly.
I just want to note here for everyone having the same issue with me.

"Unable to download application. <Appname> could not be installed at this time"

I'm almost dead now. I've been trying for about 2-3 weeks to fix that problem, but still no result. Hope anyone is able to help me:
I'm writing iOS Apps with Titanium Studio. Until Mac OS X 10.6.8 with Xcode 4.2 everything worked just fine. I was perfectly able to build apps in Xcode und deploy them In-House in our Enterprise. Now I've upgraded to OS X 10.8.2 with Xcode 4.5 and there we go...
Apps can still be built and are runnable on the iOS Simulator, but if I try now to get the app on some devices, I get a message "Unable to download application. -Appname- could not be installed at this time". This happens either through OTA distribution and through iTunes with an USB Cable.
I've searched almost the entire internet, but all I've found didn't work at all.
But if I actually try to deploy the application through Xcode it works though.
Does it have something to do with those Profiles and certificates? I've already tried to revoke them and so on, but nothing helped. I also installed OS X completely new, so that I have a clean keychain. Same result.
Would really really appreciate any kind of help. Thanks!
Finally i found a solution, when i tried to sign the App manually, the console threw an Error message that helped me to fix it again.
The Problem started when i upgraded to Mountain Lion and had to update xCode to 4.5.2
Maybe it helps others who still couldn't find a solution after several days of searching the internet
Unzip the Ipa
unzip Application.ipa
delete _CodeSignature
rm -r "Payload/Application.app/_CodeSignature" "Payload/Application.app/CodeResources" 2> /dev/null | true
if there isn't the right provisioning profile, replace it
cp "ProvisioningProfile.mobileprovision" "Payload/Application.app/embedded.mobileprovision"
The problem for me was this error when i tried to resign the app manually:
"object file format unrecognized, invalid, or unsuitable"
fix it :
export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/usr/bin/codesign_allocate"
resign the app
/usr/bin/codesign -f -s "iPhone Distribution: Company Name" --resource-rules "Payload/Application.app/ResourceRules.plist" "Payload/Application.app"
Zip it
zip -qr "Application.resigned.ipa" Payload
Thanks to
This Question on how to sign an app manually,
the console which got me the error
This Post which helped me to fix the error
Apple which makes our lives too hard
Update
It seems the location for codesigning has changed. The new path would be
export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate"
As taken from this answer
I had the same “Unable to download application. 'Appname' could not be installed at this time” message, and spent several weeks checking and renewing the certificates, rebuilding, re-doing the OTA distribution, etcetera. It turned out that I simply hadn't added the .mobileprovision files to the project. Just in case this helps anyone…

Resources