Mac App not being signed correctly - cocoa

I know there are many similar questions on StackOverflow, but I think I've read them all and none quite apply.
I have a Cocoa app that I am trying to sign for distribution on the Mac App Store. I have created my distribution profile and I believe it's all hooked up correctly in XCode. When I build the app, XCode prompts me about signing and the build finishes with no errors. When I look at the build messages, I see a happy green check mark from Code Sign.
Further, I'm using Receigen for the receipt validation, and when I use it to inspect my built app, it shows that the app is indeed signed and that the signature is valid.
However...when I copy the app to a different machine (running Snow Leopard, if that makes a difference) and launch the app there, I see that after the app quits with code 173 for receipt validation, Console shows that storeagent logs the message "Unsigned app." Similarly, when I inspect the app with Receigen, it shows that the app is signed but not valid. Why could this be?
Tangentially, in case it helps spur some ideas, the context of this is that I'm trying to get receipt validation working, and on my main dev box (the one in which the app shows as being signed correctly), when I exit with 173, I am prompted with the iTunes credential challenge, although the receipt is never retrieved from the store. On the other machine, I never even receive the credential challenge (I presume and hope this is all because of the same issue).
I'm really at wits' end here. Thank you, fine people of StackOverflow, for any ideas you might have.

For the record, the answer is in a comment from #Brian Rak:
Update: I finally got things working, but unfortunately, I was never
able to determine exactly what the issue was. However, it appears
something was configured incorrectly or corrupted somewhere in my
project file. I created a new project, copied all my source code and
resources into it, and rebuilt, and the problem magically went away.
My advice if you're seeing this would be to create a toy app that uses
the same bundle ID and if you can get it working, just proceed with
that one as I did.

Related

Cannot submit Xcode Archive to Itunes Connect. "Uploading Archive: Sending API Usage to Itunes Connect"

Hello Ive sent a version of my app one week ago through Xcode 6 and it didn't have any problem. Today Ive tried to upload a new version of my App via Xcode and when uploading, the progress bar stays in "Sending API usage to Itunes Connect". It doesn't give me any errors, nor warnings, it just stays like that forever.
Ive been looking in google and also in here, and found a lot of solutions (ones more logical than others). Well, Ive tried ALL those solutions, I've created new provision profiles, restarted my computer, restart Xcode, changed "netinfo", connect to new wifi, among others.
Its really driving me crazy since I didn't do anything, it just stopped working.
There are a lot of question with this same topic on the internet (including StackOverflow) and I think there is no one ultimate answer that really explain why this happen. Ive seen very detailed answers but none of them worked for me.
Some of this questions are:
1) Can't Submit App to App Store: “Sending API Usage to iTunes Connect” either times out or loses connection.
2) Application Loader (Apple) stuck on “Sending API usage to iTunes Connect”.
3) Stuck on “Sending API usage to iTunes Connect”.
If I export the archive into an .ipa I can upload it with application loader. I don't know why I can't do it with Xcode. Ive always used Xcode for this.
The reason I want to know how to do it with Xcode is that I don't know if uploading only the .ipa and configuring in app purchases only directly via itunes connect's webpage without doing it in application loader(the button that says "New In-app Purchases" template) , will also work.
I hope someone could help me.
Thank you.
minimise the organiser window
reopen it from mac floating menubar
This seems to be refreshing the connection while online. Works for me.
I had this same problem a few minutes ago, let me explain what I did:
Restart your router/modem
Restart your Mac
Set the active scheme in Xcode for iOS Device
Make a new archive
Validate before submit
These steps work perfectly for me, hope that helps.
I also faced similar problem. I can't upload from my office, but can upload from my home. I assumed that my office's internet connection has problem with Apple server. If you get problem with Xcode to upload, you can download Application Loader separately from iTunes connect and try with that and wait for passing sending api usage state.
Try doing this:
cd ~
mv .itmstransporter/ .old_itmstransporter/
"/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/bin/iTMSTransporter"
Seems to be working for a lot of others - https://forums.developer.apple.com/thread/76803
I couldn't make this work on XCode 7.1.
I had to upgrade to 7.1.1, which allowed me to export the binary for App Store Deployment, and then use the Application Loader to upload the app for review.
Absolutely crazy, Apple.
I've found that instead of restarting your router and machine etc, simply clicking 'Renew DHCP Lease' in the TCP/IP settings of your internet device (under Network in System Preferences) solves the issue much quicker and easier, for me anyway.
Just another error that makes working in Apples eco-system all the more fun and exciting...
There was no one particular procedure that seemed to do it in my case: restarted router, restarted Mac, restarted Xcode, recreated profiles on developer website, viewed them in Xcode, recreated archives, attempted just validating for App Store. All of these things over and over again.
My experience has been that you should just kept trying until suddenly it works. Which is sadly not the magic button to click that I was looking for.
Possibly the fact that I managed only twice in the last dozen or so upload attempts in the morning from here in the UK (making it approx 02:30 over there in the US), indicates it's perhaps an iTunes overloaded problem.
I had the same problem, though none of the suggested steps solved my problem, other than using the Application Loader.
However, one thing that bothered me was a warning message saying that:
The resulting API analysis file is too large. We were unable to validate your API usage prior to delivery. This is just an informational message.
It came to me that it might be the reason why Xcode's uploading might be messed up, since it locks at the Sending API usage to iTunes Connect.
Some people mention it in some posts here in stackoverflow.
For me Network is not allowing to upload the build as office wireless is having firewall so I had to move to other wi-fi to upload the build.
Just adding another possible answer here that fixed it for me.
I was on a VPN at work. Disabling this and trying again worked.

Code sign error in XCode - is it related to Apple developer site down

Today I got Code signing error when building my app in XCode. But when I visited the Apple developer portal, it is redirected to this address: http://devimages.apple.com/maintenance/. Could anyone kindly confirm with me that we need to wait until Apple restore everything to be able to build app in XCode. If you have any workaround for this, it is very great if you can share with me. Thanks.
If you need to download/refresh your code signing identity first then you will not be able to do anything till maintenance is over, otherwise there shouldn't be a problem besides getting the app to the store (what isn't possible cause of the maintenance)

Xcode 4.6 - "Valid signing identity not found" for Distribution provisioning profile

I'm examining the process of submitting an app to the App Store and I'm having some kind of trouble here. I've been following this tutorial.
I've created a Distribution Provisioning Profile, which I downloaded and added to Window - Organizer - Devices dragged in 'Provisioning Profiles' under the Library heading in the sidebar. What I see there is this:
I've tried revoking all my certificates and adding them once again to my Keychain Access, but it didn't help. Even after refreshing the provisioning profiles in Xcode.
Also, I've read that this happens often if I change the machine I'm working on, but this is not my case. I've developed the app on the same Mac, I'm on right now.
I'm willing to provide more information to help reach to a solution to this problem if needed. Thanks for your help in advance.
Things to check:
Make sure in Keychain Access that the certificate you are needing to use has the private key stored with it.
Make sure the bundle identifier matches EXACTLY with what you have for the AppID (unless you are using the Wildcard identifier)
Make sure the provisioning profile you selected uses the certificate created.
Make sure that you download that provisioning profile and are using that to sign the distribution settings of the target.
If all this is done, it should work fine.
Also, I gave a talk about certificates and provisioning for iOS. Here is a link to the keynote PDF which explains the process of how I do things.
Just restart XCode.
Sometimes everything done through the documentation, but XCode does not work properly.
If you are still stuck by this problem, try to do the whole process again.
Go to keychain, delete all the iPhone certificate and then do routine stuff. I faced this issue before for some reason, So I just redo it. Good thing is it won't take long time, just 5 mins : )
Hope this can help you.
I solved this issue by opening the KeyChain Utility and deleting expired provisioning profiles. I updated my profile at members page of developers.apple.com following all the instructions.
Then opened up my application with Xcode 4.6 . Under Build Settings selected iPhone Developer with my name.
My issue was the old developer profile id and the new id were the same and I did not realize this. Removing the old one allowed the new to be used.
Solution: I solved my latest run with this issue by simply choosing a Development profile and Identity and building and running and then switching back to the Distribution profile and Distribution Identity.
Background:
My build was working last night, I switched to a different branch, tried signing the same way and it just continued to fail/say that there was no matching valid signing identity).
I tried restarting Xcode, restarting Mac, deleting invalid/expired profiles etc. Then just out of a need to test a run, I switched to the development profile (I am testing IAP with the Distribution profile), then when I switched back, it just worked!
One thing that is weird during this process is that the profile on the device does not seem to match the ones I have on disk, and during that process when I tried to add the one on disk to the device it was not highlighted as a valid selection (my dev one's were).
Even after running, the device still shows some different version of the same mobileprovision (different initial code and expiry is one day different than the one I have. I am working in a shared device environment so I don't have complete access/visibility to where these versions all came from).

Mac Sandboxing: Can it really be this easy?

I'm just trying to get some confirmation on Sandboxing. I understand exactly why it's been put in place and the principle behind it.
As I start to near the release of my first Mac App I kept putting off sandboxing as it sounded rather complicated and thought I'll worry about it nearer the time. I watched a couple of the Apple videos and read up on some of the documentation (not all) and thought I'd try and add it to my app!
I turned on sandboxing in Xcode, didn't specify any entitlements as they didn't really relate to my app and the entitlements certificate popped up on the left and ran my app....that was it, all ran fine without issues.
That's where I got confused...surely it can't be that simple?! My app saves data in the background, no user input to save, it just happens seamlessly. Anyway I checked /Users/whoever/Library/Containers and there was my app named container folder and the relevant data was saved there (although of course that wasn't the exact path I specified as the save location in my app). I closed my app, reopened it and sure enough the saved data was still there.
IS THAT IT? Does that now mean my app is sandboxed or am I missing something here?
Yes, that's it. If your app really doesn't need any entitlements, not even the ability to open/save files specified by the user, then it's trivial to sandbox.

How to Suppress the keychain prompt when the app modified?

Hi Im using Mac 10.5.8 . In my app im using my own keychain(created by me), but my actual question is when I modify my code in the app every time a prompt is appearing, saying that the present app is modified do you want to allow or not.Can any one tell how to supress this prompt(allow by default when ever I change the app).I couldn't find the solution in the documentation.
The Keychain has a list of trusted applications, and this list includes a hash digest for the application. When the application changes, it becomes untrusted again. This also happens with "big" applications like Camino.
There are two special measures to reduce this: When a shared library gets updated, the system will keep track of this and accept the application even after the update. Also, when Software Update updates an app, it will fix the digests as well (which is why Apple's own apps can get away without re-confirmation).
Update: If you sign your code, Keychain will also accept updated applications (signed with the same certificate).

Resources