Could not code sign a Mac App - swift

I successfully submitted my app [ version 1.0 ] to iTunesConnect for review. And they have rejected it because I have added an extra App Sandbox feature. So I solved that thing and tried to archive my project in new build number.
Also I have selected my Code Signing Identity 3rd Party Mac Developer Application, And came back to Project Settings -> General, now I could see that the Signing switched to None and Team automatically changed to None. So I have changed that to My Team Name and Signing into Mac App Store. Now I have went back to Project Settings -> Build Settings, There the code signing identity has different identity selected [ Two Mac Developer & One 3rd Party Mac Developer ].
So what happens is that whenever I change something the opposite happen in other place. Basically I am unable to archive my project cause of code signing issue.
If I try to code sign using Mac Developer Identity, it shows me something that I never seen before.
Something like error: A cryptographic verification failure has occurred.
*** error: Couldn't codesign /Users/Alvin/Library/Developer/Xcode/DerivedData/MyApp-bjtynsmrmxhrfffdvpfwxeanbgkb/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/Contents/Frameworks/libswiftCore.dylib: codesign failed with exit code 1
So how will I solve this problem? Thanks in advance.
By the way, I am using Xcode 7.3.1 in macOS Sierra. Is that can be a problem? No right?

It seems there may be code signing issues with macOS Sierra. You can follow the issue here.
I would recommend reverting back to El Cap and only installing an early beta of a new Mac OS on a machine used for testing the OS, not one you are doing active development on.
[update 7/6/2016]
Some developers are reporting this fixed with macOS Sierra Beta 2 and Xcode 8 Beta 2, but I have not yet comfirmed on my spare Mac if this fixes the problem.
Also, some developers have reported that resetting the Keychain fixes is. In the Keychain Access app , go to "Preferences..." and click "Reset My Default Keychain".

Related

(Unreal Engine) iOS Deployment Without Paid Developer Account Won't Work

For days now I am trying to find out what I'm doing wrong can't find the right solution.
I am new to the Unreal Engine and currently trying to figure out how all of it works. I downloaded the Epic Zen Garden and the Sun Temple example project off of the "Engine Feature Samples" and wanted to deploy them on my iPhone XR, but I can't.
I looked through about 10 possible solutions but none of them really worked and somehow there are several ways to handle this matter so I wanted to ask you to eventually share your workflow regarding building apps on iOS using Unreal.
My setup:
Unreal 4.23 and 4.24 /
iMac 2017 with OS Catalina 10.15.1 /
iPhone XR with iOS 13.3 /
Xcode 11.3
As the title mentions, I am trying to find a solution without having to spend $99 for the Paid Developer Program.
What I did so far:
I've opened up Xcode and created a new project. I automatically signed in with my free developer account, used an bundle identifier and deployed the app on my iPhone. What happened now is that a provisioning profile and a certificate is created.
I then switched back to Unreal, opened the project settings -> iOS and used the same bundle identifier like the on in the Xcode project.
The mobile provision and certificate show "valid" and I also checkmarked them.
I then choose my device within Unreal under "Launch" and 2 error messages pop up saying "Provision not found" "Signing key not found". Why though? It shows up as "valid".
When I try to launch Launch -> Project Launcher -> iPhone -> I suddenly receive following error:
ERROR: Stage Failed. Missing receipt '/Users/myName/Documents/Unreal Projects/SunTemple/Binaries/IOS/SunTemple.target'. Check that this target has been built.
So what am I doing wrong? This solution came up the most while searching for ways to handle this problem.
I would be thankful if anyone could share his steps.
Best regards
Daniel

Installing provisioning profile on device does nothing xcode 6

I have a valid provisioning profile, the program I'm running works fine on one of my iPhones. However, for some reason I cannot add it to my other iPhone. Here's how it looks:
Show provisioning profile
Click to add one
Select my provisioning profile
Aaaaaand nothing happens
Has anyone else experience a similar problem or does anyone know what might be the solution? As of just now it just seems that xcode is unresponsive.
Rkey, I had this same problem. If you haven't found a solution, this is how I solved mine.
Instead of trying to install a provisioning profile by yourself, run the app on the device without trying to set it up yourself. Now, if I'm not mistaken, you'll get the "no provisioning profile found for this executable" message or something like that.
You need to change the Code Signing Identities in the build settings of your Xcode6.
Change everything [Code signing identity, Debug, Any SDK, Any iOS SDK, Release, Any iOS SDK)to iOS Developer and set Provisioning Profile to Automatic.
After that, if you try to run the app on the phone again, the prompt will give you an option to "Fix Issue" and clicking on "fix issue" solves the problem.
Hope it works for you.
Go to apple portal and add all the required devices there.
Then go to the provisioning profile you want to download, edit it and make sure the following things:
The App ID associated with the provisioning profile and your App ID in the info.plist is the same.
All the required devices are included in this profile(they are checked marked for the profile).
Check the associated provisioning profile certificate is valid and you have a private key pair for that certificate.
In xcode settings select the provisioning profile and code signing
identity(the certifcate) for the scheme you are running the
application.
Updated answer for XCode 10 ...
See here: https://stackoverflow.com/a/52434756/3216970
Ran into this w/an Ionic app initially created w/XCode 9.
Absolutely none of the usual fixes for automatic/manual profiles or certificates worked.
The issue was with XCode 10's "new & improved" Build System. It just doesn't work w/older projects, and none of the error messages actually explain why.
Go to File -> Workspace Settings.
Change Build System to "Legacy Build System"
Now magically the Provisioning Profiles show up on your device and you can deploy the app you needed to get on a device 3 hours ago when you started messing with this provisioning BS for the umpteen-dozenth time. Thanks Apple.

Can't launch my app in Instruments: At least one target failed to launch

I have all my code signing entitlements set correctly. Running the app on my phone is fine, but launching it in instruments gives me an error message:
Error Starting Recording
At least one target failed to launch; aborting run
And then:
Target failed to run. Permisson to debug [app name] was denied. The app must be signed with a development identity (i.e. iOS Developer)
Any ideas how I could stop this from happening? Doesn't happen on my iPad.
Edit the scheme for your target and under "Profile [App Name]" set the Build Configuration to Debug (it's usually Release by default).
It is saying that you need to sign the app with a developer certificate (not a distribution certificate).
In Xcode 5 just change the "Provisioning Profile" field for your "Release" build in the Build Settings to your developer certificate instead of your distribution certificate. For the duration of the testing anyway. Xcode doesn't allow you to build with a distribution certificate.
Make sure that the project build settings do not override the target build settings or make the change in your project build settings.
Don't forget to set the profile back after you're done with the testing.
I do not recommend harrywynn's method, since it is better to profile the release build because then you are taking into account the compiler optimizations, and having the exact experience your users will.
To add to the previous answers.
Instruments is complaining about the signing identity.
I believe it is preferable to profile in release mode, for the same reasons given by Zolten. (take into account the compiler optimizations, and have the exact experience your users will, etc...)
To change your code signing identity for Xcode 6:
Click on your Project, Select the Target you are Profiling.
Build Settings -> Code Signing -> Code Signing Identity -> Release
Select your iOS developer profile.
Provisioning Profile: Let Xcode pick the correct Provisioning Profile for you, e.g: switch to Automatic
When you are done with the Profile, switch back to your normal settings.
Here's a picture for those who are very visual ;)
I was getting the same issue :
[INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug was denied. The app must be signed with a development identity (e.g. iOS Developer).
Solution:
1. I archived the the app with Debug Developer Profile in xcode for device.
2. The go to Window -> Organiser -> to see all the list of archieves
3. Now select the archive to wanted to export and open it in finder
4. Right click and show package contents
5. Go to the Products/Applications folder
You will see the .app file.
Use this instead of the ipa.
Make sure that the device has been already added to the developer portal and all the certs are installed on it for the above steps to work.
Once this is in place. Also, make sure you get the ios-webkit-debug-proxy from the link below:
https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/ios-webkit-debug-proxy.md
Also, enable developer tools on on the device setting.
Also, make sure safari webinspector (safari -> Develop) -> Inspector is on
Hope it helps:-)
NOTE: When you want appium to install the app on the device for you, don't provide Bundle ID.
I achieved to solve this issue on my machine by doing this :
Generate a new Developer Provisioning Profile with your device in the list or at least make sure that your machine is in the list of the profile's device.
In Project settings -> Code Signing -> Provisioning Profile -> Debug : Set the newly created profile.
In Targets settings -> Code Signing -> Provisioning Profile -> Debug AND Release : Set the newly created profile.
Hope that helps.
I realised what "At least one target failed to launch" means. It appears that both the development and release schemes (if you have a debug scheme and a release scheme) must have a development identity.
I had the debug scheme selected when running the profiler and the message at the top of XCode said "Running debug". However, it seems that this is not sufficient.
I changed my release scheme code-signing identity to be the same as the debug scheme (and also the provisioning profile), and the problem went away.
it worke.. when i changed my profile schema to debug mode and also made sure, build configs has developer certificate in it. Thanks
None of the other solutions here fixed my problem, but I did determine that it was only a problem for me on the simulator. The device works fine. Perhaps there's an issue with the simulator.
I encountered this problem with Xcode 9.1 for both simulators and devices, and my running scheme was already set as profiling with "Debug". Finally found this Apple forum discussion very helpful and got the problem resolved. In short, the solution that worked for me is ... Restart the Mac.

iPhone app could not be installed at this time [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 months ago.
Improve this question
I was trying to install my iphone application from testflight.
It installs perfectly on few devices but in some after installing about 80 percent it gives an error Unable to download application, <my app> could not be installed at this time
I am able to find out the reason for, why is it so?
Here's a screenshot:
clear your cache and cookies in Safari, make sure your device is in provisioning profile and provisioning profile is installed on the device.
If everything mentioned above didn't help, try to create a new build with higher build number and try to distribute your app again
Most common issues that cause this are (from testflight's website):
Device storage is full
The provisioning profile is a developer provisioning profile
The ad hoc distribution provisioning profile is corrupted and the device is having an issue with it.
The device was restored from a backup and is causing a conflict for over-the-air distribution
There was a network timeout
Architecture settings of the build and the device are incompatible ( can sometimes happen -when "Build Active Architecture Only" is on when building).
Not Using Mobile Safari.
for me it turned out that my client's ipad was running iOS 4.2.2 and my project supports 5.0+.
Recently default Xcode project settings set ONLY_ACTIVE_ARCH (Build Active Architecture Only) to yes for Debug configuration.
So your build can not be installed on different hardware than the one you use for development.
Change this setting and installation should go fine.
As for Xcode 5.1, the problem was in arm64 architecture in VALID_ARCHS. Building the release configuration for 5.0 device locally gives the following error:
Xcode cannot install or launch applications supporting the 64-bit architecture on devices running iOS versions prior to 6.0. This configuration is supported for distribution through the iOS App Store, but cannot be used during development with Xcode. To continue, edit the Run scheme action and select a build configuration that does not include the 64-bit architecture.
Removing arm64 from VALID_ARCHS solves the issue. In my case I had to create a separate branch for testing on iOS 5 devices.
You can try to publish the application by changing the version of the build.
I was also having the same problem and tried the same by just changing tIt may help you too.
For me Setting Build Active Architecture to NO... works and installed successfully
Watch the console through the Xcode Organiser for the device that is failing to install.
You'll get a helpful message from the system telling you what is wrong. There are lots of potential failure reasons, so unless you check the message, you're just guessing...
Here is what worked for me:
Clear the Cache and Cookies (Settings > Safari).
Remove existing profile (if any) linked to "Test Flight App" (Settings > General > Profiles).
Open Safari and go to https://testflightapp.com/. Login and follow the steps to start over.
P.S. I used to have a Test Flight App, but it looks like it crashed and the icon turned to be all white. Restarting my iPhone made it reappear correctly.
I was also having this problem, with an Ad-Hoc iPad application, when trying
to install it on a iOS 6 device.
What fixed it for me was to click on the project in XCode, and change the
"iOS Deployment Target" setting from 5.1 to 6.0.
And there was silly me thinking that iOS 5.1 apps would run on a iOS 6.0 device.
I just saw this as a result of a network error / time-out on a flaky network. I could see the progress bar increasing after I got the bright idea of just retrying. Also saw HTTP Range requests on the download server with ever increasing offsets of a few megabytes (the entire app was about 44MB).
I had this problem but I fixed this by making sure my Code Signing Identity is the SAME as the one I used in test flight.
After that, everything works fine
This can also happen if you disable cellular data for "App Store" (for example, while on vacation) and forget to turn it back on. The solution here is to simply re-enable it in Settings -> Cellular.
in my case app want to use iCloud services, but in distr. provision profile wasn't set iCloud enabled. turn it on and refresh profile.
I have had the same issue after fiddling around with certificates (argh).
The problem became apparent as I followed the comment of #Duraiamuthan.H, I installed on a device. The device reported 0xe8008016 (Entitlements) see SO here
The initial reason was, that the testflight target used the App store distribution certificate, not the Team certificate. I fixed that and the application was installing on the device over Xcode and then it also worked with testflight.
I had similar issue. However, I was able to fix it when I updated my iPad timings to that of current. I just checked the device log and found that the time in the log was shown 2 years before.
Hope updating the device timing to the current time will fix the issue.
Missing icon could be a problem. My manifest file points to a non-existing image and it fails the installation process. Placing an icon at the corresponding path solved the issue for me.
I ended up creating new Provisioning profiles, not sure if it was because of:
"The ad hoc distribution provisioning profile is corrupted and the device is having an issue with it."
I had the same problem as #mohitum007. In my case the developer of this App included an expiry date in it.
As workaround I set the date backwards to a past date (e.g. last month). Then I could install it and use it.
Also when I set the date back to normal, the already installed App didn't start up anymore. I contacted the company of this App to send me an updated version.
Sidenote: I found out that users from other Apps had the same problem but reversed: it won't install or start before a certain date.
For me, just uninstall the Testflight and restart my iphone. After that, install TestFlight, it works fine !
Check if the deployment target in the General section of the project settings, is greater than that of your device's iOS version.
If yes then you need to update the version of your device to at least the deployment target version. in order for you to be able to install the application on your device.

Xcode iOS organizer submit to app store yields "The archive is invalid" error

I just switched from Xcode 3 to 4. When I attempt to upload an app that I have archived to the organizer, I receive this error:
The archive is invalid.
/var/folders/.../app.ipa does not
exist.
This happens after I log in to itunes connect, select the application to update and select next. I am not sure where to begin trying to figure out what is causing this error. Please let me know if I am leaving out anything that would be useful for diagnosing. Thanks
I just faced this problem myself, and I seem to have found a solution to it.
Even though the correct provisioning profile seems to be selected, it might not be.
Try to manually navigate the list of possible provisioning profiles and select the correct one. Do not leave the setting on automatic selection.
In the "Identity:"-list, make sure it does not say "Currently matches...". Manually select the correct one yourself.
That should fix the problem and you should be able to upload to the AppStore.
Okay, so when you install the Xcode 4 package, make sure you have the "Unix Tools" option selected. This was the problem in my case.
If you are running an Xcode beta version (Apple calls it a "developer preview") you will get this error because you're not allowed to submit apps from a beta version. This restriction is not mentioned in the Read Me file or on the Xcode download page. To submit an app, you will need to uninstall Developer Tools, then reinstall the latest non-beta version, then restart your computer.
Here's the command-line command to uninstall:
sudo /Developer/Library/uninstall-devtools --mode=all
Quit Xcode
With a text editor open the file YourProject.xcodeproj/project.pbxproj
Delete all lines containing PROVISIONING_FILE =
Delete all lines containing CODE_SIGN_IDENTITY =
Save & close project.pbxproj
Reopen your project in Xcode
Clean the project
In the Build Settings pane choose the correct code signing identity
Rebuild
I recently switched to a new MacBook Pro and had XCode 4 installed from a Time Machine drive via the Migration Assistant.
Re-installing XCode 4 with the Unix Tools fixed it.
For some reason those files weren't getting copied across with Migration Assistant.
I had the same issue for both TestFlight and App Store. The solution for me was to archive the app, and in the organizer select "Don't sign" when you try to validate/submit or share (in the case of TestFlight).
Hope this helps.
In my case this has nothing to do with Xcode or the unix tools. Indeed I happend to had too many distribution certificates (Why? I don't know). Deleted all of them but one, code sign with this one, re code sign it while validating and submit it with no errors. I hop this help.
A good way to test is to run the build from the command line. Change to your project folder and run 'xcodebuild' and look carefully at the outputs, especially around the 'codesign' command.
I did this and discovered the following:
architecture armv7 object: /Users/chris/Documents/x/x/build/Release-iphoneos/x.app/x malformed object
object file format invalid or unsuitable
So it isn't a solution, but it at least lets you zero in on what the problem is. Anyway, for me, looks like an architecture config error.
Update - to fix this problem, i replaced the copy of codesign_allocate in my /usr/bin folder with the one in /Developer/somewhere and that fixed it.
I tried most of the ideas above, and they did not work for me, likely because I am using he Appcelerator Titanium platform. I did however delete the Build directory and re-built the product and it passed the validation and I was able to upload the binary to the app store.
The same happened to me. My mistake was I had certificates with similar names (like "Provisioning Profile of Giammy", "Profile for Provisioning of Giammy"...).
Running "Archive" from XCode 4.0 and then "Validate..." from the Organizer I faced the "app.ipa does not exist" issue. The problem was that I selected the wrong certificate from those with similar names. The "Archive" phase worked good but the archive did not pass the validation.
Solution: just picked up the correct provisioning profile in the "Archive" phase.
Lesson learned: check twice the provisioning profile name!
Make sure that you are signing with keys for correct product/bundle ID. If I remember correctly, mixing that up could lead in archiving problems.
Also, go to that temp folder and check what IS created. Maybe xCode is creating the IPA under a different name, that could give you a hint.
I solved this same problem by deleting all of the expired signing certificates from my Keychain. Xcode seems to just grab the first one it finds with the given name, regardless of whether it's still valid.
I tried everything including reinstalling xcode4 with unix tools. NOthing works.
I assume I shouldnt have to do this as I'm able to submit other apps without issues.
I'm just having this issue with a partiular project (coming from xcode3).
I even created a project from scratch, imported all the code over and tried again - failed.
so it's not only my project but something in it.
So I've started the process of creating a new project, adding some files, then submitting, then rejecting to figure out what's causing it. This is working so far.
update: ok - it has something to do with using CorePlot and linking it in as a library. and voila - found the answer here.
Can't submit app with CorePlot using Xcode4
Solution: when submitting select "Don't resign"
I was not able to solve this problem by changing or fixing code signing identities (which should resolve this problem in many cases. Nor did simply reinstalling Xcode. These are the top two solutions as I post this answer.
I found success in uninstalling all the developer tools, and reinstalling from scratch.
Here is how I solved it:
Open Keychain and delete all distribution certificates, both from my "login" and from "system".
Download the latest Distribution certificate from the Dev Center.
Double click the certificate to install on Keychain.
On XCode, make sure the certificate name matches on Build Settings.
Build for Archive (a Keychain popup should ask for permission to sign the app).
Archive (again, Keychain confirmation required).
Validate archived app (again, Keychain confirmation will be required).
Submit app (one more time, Keychain confirmation will be required).
If you are building for Archive and you don't see any Keychain confirmation dialog, you can stop at that point because submission is not going to work.
i did have this very same issue using xcode_4.2_and_ios_sdk_5_beta__snow_leopard, my working solution.
Install the previous (non-beta) version of Xcode in a different location and work with that version, and that's it, it worked i was able to upload my app to the AppStore without any inconvenience.
regards,
Jorge.
Never try to submit using apps you built using beta SDKs as your base SDK.
I got rid of this problem by uninstalling all developer tools with the below command
sudo /Developer/Library/uninstall-devtools --mode=all
and then restarted my system and installed that latest non-beta version of XCode and non-beta iOS SDK.
Have you been playing around with the ENTITLEMENTS_REQUIRED attribute at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.3.sdk/SDKSettings.plist (let say to create jailbroken applications)?
In this case, please reset ENTITLEMENTS_REQUIRED to YES.
for xcode 4 I tried every thing but I can t solve this error until
install xcode 4.2 for snowleopart
if you cant see your app icon in validation page its can be your xcode have error.
download from apple developer page xcode 4.2 and install. its solved.
you dont need to uninstall your xcode 4 just download new xcode 4.2 and install.
I am very fine now
My solution was:
Open the info.plist file in your project and in product name write your products name instead of $[PRODUCT_NAME]
Had this error in Xcode, but had no such error when using the Application Loader. Get to it via Xcode -> Open Developer Tool -> Application Loader. Very frustrating indeed.