/usr/bin/codesign failed with exit code 1 in Xcode 6.4 (yosemite 10.10.5) when trying to run on iPad - provisioning-profile

Everything started when I tried to create and validate my archive for the new app version.
My developer certificate expired, I revoked it (I didn't revoke distribution certificate it is still valid) and now it is up to date. I deleted my old associated provisioning profiled from Xcode and Xcode is configured to generate them automatically. After The provisioning profiles were not in my account. I was able to compile fine without errors using simulator, but I can not run app on my iPad. I deleted old app version (I could not find in iPad Settings->General any Profiles to delete since my version is iOS8.4 and it deletes it automatically) I don't know if I need to delete anything else on iPad?
Now when I try to run from Xcode app on iPad, I get this error:
Command /usr/bin/codesign failed with exit code 1
(see details below)
NOTE1: I don't get this error when I run it in the simulator, only when I chose to run on registered iPad
NOTE2: I was able to run app on this same iPad before I revoked the certificate.
NOTE3: I was able to create archive and submit the app before, problems started when certificates expired.
All troubles started after revoking the certificate.
I am running Xcode version 6.4
Mac has OS X Yosemite Version 10.10.5
Here is what I did so far:
After revoking certificates,I tried to delete provisioning profiles and restart Xcode, Mac and iPad and that didn't help.
I deleted old certificates from keychain, right now I have just the new up to date certificate in my keychain.
When I tried to run Xcode it asked me to fix non-existing provisioning profiles and it worked for simulator, but not for iPad.
I also looked in Xcode general settings for the build and tried various things, but that didn't help...
This didn't help too:
Xcode -> Preferences -> Accounts -> Choose your account, and then View Details -> Refresh (button on bottom left), Refresh again, restart Xcode
I tried to read developer guides for distribution, but troubleshooting suggestions how to run on development device didn't help, also I didn't find much about this codsign error.
I also downloaded new certificate WWDR from Apple, that didn't help.
I tried most of the things what people suggested related to this error posted, but didn't help...
One additional info:
My problem is also that I am trying to submit second version of the existing app, so I don't know what I can delete in order to be able to submit the updated version of my app again. If it was new project I would create new project from scratch and start from zero, but this happened just when I was ready to submit new archive...
Do you have any suggestion how to fix this issue, which steps to follow?
I would appreciate your pointers where to read or what to do.
If you need additional info from me, please let me know.
Thanking you in advance, -Tatjana
CodeSign /Users/t/Library/Developer/Xcode/DerivedData/K-eskcdowdkybtiygveputefcuziqr/Build/Products/Debug-iphoneos/K.app
cd /Users/t/Desktop/myProjects/K
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export 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"
Signing Identity: "iPhone Developer: T... (G....)"
Provisioning Profile: "iOS Team Provisioning Profile: com.k.K"
(5....)
/usr/bin/codesign --force --sign D.... --entitlements /Users/t/Library/Developer/Xcode/DerivedData/K-e.../Build/Intermediates/K.build/Debug-iphoneos/K.build/K.app.xcent /Users/t/Library/Developer/Xcode/DerivedData/K-e..../Build/Products/Debug-iphoneos/K.app
CSSM_SignData returned: 8001094A
/Users/t/Library/Developer/Xcode/DerivedData/K-e..../Build/Products/Debug-iphoneos/K.app: errSecInternalComponent
Command /usr/bin/codesign failed with exit code 1

Related

Install claimed to have succeeded, but application could not be found on device Xcode 11

Just after switching from Xcode 10 to 11, I am unable to install my app on any device
The error at launch time after installation succeeded says :
Install claimed to have succeeded, but application could not be found on device.
Details says :
Could not locate installed application
Domain: com.apple.platform.iphoneos
Code: -1
Recovery Suggestion: Install claimed to have succeeded, but application could not be found on device. bundleId = myBundleId
--
Installed application was not present in database of installed apps after multiple lookup attempts.
Domain: com.apple.platform.iphoneos
Code: -1
However everything works fine on a simulator.
I tried to delete derived data, clean project, delete the app ..
Very strange : After submitting the app to testlfight I can download it and it works.
But when I build a new app to Xcode it launch the app just downloaded from tesflight and not the version pushed via Xcode ..
For me, it's a problem with ipatool.
Here's a way to find out details why it failed to create a proper iPhone App (.ipa) file from the build output/Xcode archive:
Go to Product > Archive, then open Window > Organizer > Distribute App.
It should show you "IPA processing failed" with a big red error symbol.
Now, open the logs and search along these lines:
timestamp Assertion failed: Expected n archs in otool output:
and
timestamp /Path/to/ Xcode-beta.app/Contents/Developer/usr/bin/ipatool exited with 1
While this can't be the final solution, try removing all problematic libraries mentioned in the logs between the two lines until ipatool exists successfully.
I also had this issue/error message. I realized that I had automatic signing deactivated and I had selected a provisioning profil with a distribution certificate.
Solution:
So if you want to run the app on your iphone directly from Xcode (not through testflight) you have to make sure you use a provisioning profil with a developer certificate.
This is probably not the case for most people facing this issue, but I faced it once several days ago and easily dealt with it by cleaning the build folder and switching to a legacy build. The second time I faced it, none of the suggested solutions seemed to be working.
I then noticed that because I'd almost run out of storage on my device, iOS had "offloaded" almost all of my apps. If there is a small cloud under your apps and the app needs to "install" again before launching, then this is the case with your phone too. Trying to launch all of the apps that I don't use regularly (so I never noticed the little clouds) "reinstalled" all of them and solved the issue entirely. Maybe this helps someone facing this for similar reasons.
I have the same problem,I modify the project setting
File --> Workspace Setting --> Build System --> Legacy Build System
it's OK for me
I also got this alert. That's because i run the app in release Build Configuration, but with a appstore Provisioning Profile . It's not allowed. So i change the appstore Provisioning Profile to a dev Profile. Then everything is ok.
Hope this can help you.
I found a way to solve this problem. After I upgraded iOS 13.1, the real machine also ran. Later, I found out that because I had archive operation the day before, the real machine running certificate changed from distribution mode to development mode and everything worked normally.
For my case (xcode 11, ios 12.4), change the Bundle identifier can solve this issue...
Before changing Bundle id, I've tried
using beta xcode
deleting app on iphone
deleting derived data
cleaning project
reopen xcode
Here's another solution. I had previously installed three other apps using XCode and got this error message when I tried to install a fourth.
I simply deleted one of my three existing apps (after hours of hair pulling and SO searching) and tried again. It worked.
Platform: iPad 2018 on v13.1 with XCode v11.1,
I was using different signing team/certificate for ...Tests target.
Setting the same for main target helped.
Update pods if you have.
pod update
just it.

xcode 8 push notification capabilities and entitlements file setting

when using xcode 8 doing the push notification setting, unlike xcode 7, xcode 8 need developer turn on push notifications capabilities switch ( located at TARGETS -> AppName -> Capabilities as following pic ),
then it will generate AppName.entitlements file as following
//AppName.entitlements
<key>aps-environment</key>
<string>development</string>
but for production version App, if we change the string to
//AppName.entitlements
<key>aps-environment</key>
<string>production</string>
then the Capabilities show a warning
and it seems no matter which string value specified in aps-environment, we can still get the push device token at application:didRegisterForRemoteNotificationsWithDeviceToken:
so what is the correct setting of the push notification entitlements?
thank you
I was struggling with that today in Xcode 8 GM. After disabling the setting, deleting my developer portal provisioning profile and regenerating it and enabling the setting again, I was able to eliminate the warning in Xcode. Keep in mind that I didn't fiddle with the entitlements file. I left it at development environment and after archiving I got the correct aps-environment setting (production).
Seems Xcode is stilly very buggy tho even in GM
My problem was my pusher client was out of date and would only push successfully to debug tokens. Other issue which I am still working on a fix for is that I could only export the app via gym with legacy-api enabled, this was not setting the apns-environment to be 'production' and leaving it as 'development' in the 'embedded-mobile.provision' file. I have however been able to successfully deploy the app via the xcode organiser to work with apns(prod) now.
I think the better solution is open the project package and open project.pbxproj
change the CODE_SIGN_ENTITLEMENTS
CODE_SIGN_ENTITLEMENTS = "your-app/production.entitlements";

Enterprise build for apple watch

I am trying to create enterprise build for apple watch project by xcode 6.3
I tried to build by archive and by auto-build (shenzhen tool)
When I run it at iPhone, it crashes immediately but with ad-hoc build it's work fine.
I've found that Xcode Automatic selections do not work properly for code signing and provisioning profile when used with Apple Watch; sometimes it makes the wrong choice and you only notice when it has problems installing and launching.
For each of the App, App Extension, and Watch App, select the code signing certificate and provisioning profile explicitly (not automatic) in the pop up list.
For issues upon launch on the device (from spring board) the device console gives good information. Install iOS Console, from lemonjar.com to easily see such information.

code signing error while integrating bot for simulator only

I am integrating bot to run on iOS simulator only not any device but still getting code signing error- No matching codesigning identity found: No codesigning identities(i.e. certificate and private key pairs) code signing is required for product type 'Application' in SDK 'iOS 7.0'
I have selected only one simulator under specific devices at the time of creating bot.
Why this is the problem for simulator too.
I have also tried by checking don't code sign option. But integration still failed with error-
CodeSign error:code signing is required for product type 'Application' in SDK 'iOS7'>
How to fix it?
Plz help...
Why not to add development provisioning profile to that OS X Server? Just send the file to that machine and open it with Xcode.
To make sure everything goes OK I'm usually checking that I can run my app on that server just from Xcode.
Don't code sign option is not working now because, as you can see, code signing is required in the iOS7 SDK. Not sure if it's a bug or feature.

application is closing just after first launch

I have build signed the iPhone application with Adhoc provisioning profile,after installing the application directly through Xcode it launched and then closed. I want to know this is correct behavior or something is wrong in my source code?
I am using Snow Leopard 10.6.6 version of Mac OS.
Please consider the following :
restart xCode
ensure the adHoc provisioning profile is properly installed on the device using the Organizer.
do a clean & build
use the organizer summary panel to add application on your device.
if still failing, please try to restart your device.
if still failing, provide us logs you might have within the console.
Hope this helps.

Resources