Xcode Build Error - CodeSign - ios

I am trying to test my iOS application on my iPhone. I keep getting the same error.
/Users/usrname/Library/Developer/Xcode/DerivedData/Navigation-abxszioyejjvsqfxzhvoyunubgef/Build/Products/Debug-iphoneos/AppName.app: replacing invalid existing signature
/Users/usrname/Library/Developer/Xcode/DerivedData/Navigation-abxszioyejjvsqfxzhvoyunubgef/Build/Products/Debug-iphoneos/AppName.app: CSSMERR_TP_NOT_TRUSTED
Command /usr/bin/codesign failed with exit code 1
-My provisioning profile and signing requests are good and valid.
-All certs/profiles/devices/App IDs are good and valid.
-I have tried deleting and re-creating the certs several times with no luck.
-The certs are set to use System Defaults instead of Always Trust
-My App ID is set to a xCode wildcard 123456.*
-I have set my Bundle Indentifer to justsometext, as from what I read in the docs, this doesnt matter because of the wildcard.
Can somebody please help me before I rip my hair out. Thanks!
I am using the latest version of Xcode and latest iOS on iPhone.

Have you correctly set the "Trust" section of Apple's WDRC certificate?
http://natelyman.com/index.php?option=com_content&view=article&id=105:what-is-cssmerrtpnottrusted&catid=39:iphone-sdk

Related

Xcode - Can run app on simulator but not on device - error: Failed with exit code 1

I am trying to install my AR app onto my device. If I build it onto the simulator it installs but obviously I can't test it as its not possible to run AR on simulator.
The problem is that when I try to run it on my device I get this error
error: Failed with exit code 1
The error above this is
Codesigning /Users/myName/Library/Developer/Xcode/DerivedData/ARanalytix-efmsytiskdgeajgnizwosccslwsj/Build/Products/Debug-iphoneos/ARanalytix.app/Frameworks/libswiftQuartzCore.dylib
/usr/bin/codesign --force --sign 239D4B0E67A04154536E45B1893911C2673A85F5 --verbose /Users/samosborne/Library/Developer/Xcode/DerivedData/ARanalytix-efmsytiskdgeajgnizwosccslwsj/Build/Products/Debug-iphoneos/ARanalytix.app/Frameworks/libswiftQuartzCore.dylib
/Users/samosborne/Library/Developer/Xcode/DerivedData/ARanalytix-efmsytiskdgeajgnizwosccslwsj/Build/Products/Debug-iphoneos/ARanalytix.app/Frameworks/libswiftQuartzCore.dylib: errSecInternalComponent
I have tried cleaning my project, downloading certificates again, and also followed the steps from here but cant get it to work.
Any help would be great as I am out of ideas. Thank you in advance.
I tried restarting my Mac and also deleted the certificates from my keychain. I then changed my bundle identifier name and it all seemed to work. Thank you for your help!
There are couple of reasons why it doesn't run.
1) You need a download a develop provisioning profile, if you are using a production certificate it will not run.
2) Be sure from Apple portal to include you device UDID and download a new development provisioning profile including your device.
3) From the project plist be sure to select the correct provisioning profile.
Did you Restart Mac and iOS Device. Hope this will work

Xcode 9 - Alamofire Pods. Command /bin/sh failed with exit code 1

/Users/Alex/Library/Developer/Xcode/DerivedData/MyProject-ehabmnclpzlywhabrefntacibonm/Build/Intermediates.noindex/ArchiveIntermediates/Fuego/InstallationBuildProductsLocation/Applications//MyProject.app/Frameworks/Alamofire.framework: unknown error -1=ffffffffffffffff
Command /bin/sh failed with exit code 1
I got this issue when I Archive my project. When I run app on simulator it works ok without such issue above.
Also it works ok with Xcode 8, but now when I try to Archive it on Xcode 9 I have this issue. But maybe this is not the case as I reinstall Mac OS from scratch, so it maybe cocopods version issue I am not sure.
Also two // here in the example above is also strange for me /Applications//MyProject.app
I believe it's a Xcode's bug. Restart your Mac and try to build again. Xcode would ask permission to access your Keychain before build Alamofire, then just allow it.
Hm it's very strange after some search on the Web I found that this is actually signing issue.
I used Xcode to generate new distribution certificate and maybe this leads some problems for me.
What I did to solve my issue.
I removed all certificates on my Mac and in my apple account.
I removed all prov profiles as well on my Mac and in my apple account.
I requested certificate and save it on the disc manually (not via Xcode )
I recreated certificate and profile. Downloaded it manually and double click on it.
After that I faced with keychain issue when I can not enter password to allow signing my certificate. I use this link to move certificate form login to system section.
Finally I get it work.

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.

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.

Xcode / Why do we need to copy ~/Library/MobileDevice/ to /Library/MobileDevice/?

While running the command cordova run ios, or ionic run ios, I came across this error:
Check dependencies
Code Sign error: No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID “31e9e9bb-8da1-48c6-9256-ec365145a0ac”, however, no such provisioning profile was found.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.1'
At first glance, I decided to refresh my provisioning profiles, ensuring that they were valid and reachable.
However, same issue occurred.
I'm pointing out that running the app from Xcode directly worked/works great.
Until I ... came across this post, suggesting to run this command:
cp -r ~/Library/MobileDevice/ /Library/MobileDevice/
Tried it and...the whole works!
I found that very...ugly and totally non-intuitive.
May anyone explain the essence of this kind of copy?
Isn't Xcode smart enough to handle that automatically?
That works, indeed, but I never want to admit things I don't figure out ;)
I don't understand what I've done.

Resources