iCloud and Core Data not working - URLForUbiquityContainerIndentifier is nil - ios

I am not that familiar with iCloud integration. I read numerous bad reports about the integration in iOS 5 and 6. But now I guess it's better in iOS 7 so I decided to add it in one of the new apps I'm working on.
From what I read and saw in the WWDC 2013 CoreData/iCloud video I thought it was as simple as flipping on iCloud in Xcode and configuring the NSPersistentStoreUbiquitousContentNameKey value to something unique in the addPersistentStore call, to get started. But each time I run the app, in the simulator or on a physical iPhone, the console output shows the iCloud setup failed due to URLForUbiquityContainerIdentifier returning nil.
I am using Xcode 6 beta and the iOS 8 beta 2 SDK. I've made sure iCloud is signed in and otherwise functioning on the simulator and physical devices. I've also made sure that the "Documents/Data" switch is on under iCloud setting and the app IS appearing here. I've also browsed to the simulator application directory and I see the SQLite file in the normal documents directory and in an iCloud directory.
Is there something really simple I'm missing?

There is bug in Xcode 6 beta version , i am using Xcode6 beta 5 and facing same problem.
I changed key com.apple.developer.icloud-container-identifiers to com.apple.developer.ubiquity-container-identifiers" (ubiquity, not icloud). Then add an item to this as "iCloud.$(CFBundleIdentifier)". In "Capabilities" tab Xcode will show error in red mark but don't fix it , leave as it is.
If solved my problem and i am getting Url now.

Not sure what the developer agreements allows to say, but at the time of writing this, it is still beta and most probably is a bug in xcode 6. There may be a few threads on the developer forum on that exact same subject. Search for 'URLForUbiquityContainerIdentifier' and you may find more information.
Try beta 4. My iCloud code is now working.

You didn't mention configuring your app ID for iCloud access and updating your provisioning profile, so that's probably the problem. The device needs to know that your app is allowed to talk to iCloud, and it does that based on the provisioning profile. You'll need to go to the iOS developer site and:
Update the app ID to add the iCloud capability
Regenerate the provisioning profile so that it includes the new capability
Download a new copy of the profile and make sure that you're using it in testing (it's best to delete the old copy first just to be sure).

Related

Bundle ID not listed App store connect new app list (Xcode 11.4.1)

I have created a developer account for two weeks, and now I want to submit my first App. However, when I click new app, the bundle ID list does NOT show the project I would like to submit, but It do show some projects I used to practice. I have look up a variety of solutions on internet, including sign out and log in again, or clean up my Safari data. I have suspected some reason, but I'm not quite sure if it right?
First doubt : some SDK import?
The Bundle ID shows on the list are some small project I used to practice when I was a beginner. Recently, I have tried to use some SDK like Facebook SDK and Firebase. Facebook and Firebase works fine on my simulator and iPhone devices. So I'm not quite think this might be the reason, nut just type on in case I missed something
Second doubt : Xcode version?
When I tried to using Firebase, since iOS 13.3.1 seems not to support, so I update my iPhone to iOS 13.4.1. However, the Xcode should also be updated to 11.4.1, otherwise it cannot connect to my devices. When I look up the bundle IDs listed on App Store Connect, I think those projects are created before I updated Xcode. The project created after updated not showed on the list. But I have created too many projects to practice, so I'm not quite sure I remembered right. I suspect this might be the reason, anyone else met the same problem after updated Xcode?
By the way, there is also a strange thing confused me. I have deleted some projects I used to practiced on my MAC, but they stilled shown on the list... I have manually deleted on my Apple Developer Web.
1) Go to https://developer.apple.com/account and set up the app with its explicit bundle ID.
2) Then go to https://appstoreconnect.apple.com > "Create new app" > Select the previously created bundle ID.
This does not really have anything to do with SDK usage or Xcode setup. (Automatic code signing might do some steps for you, but the most bullet-proof way is mentioned above)

Xcode 8.3.3 "No accounts with iTunes Connect access"

When trying to upload an App to iTunes connect in Xcode 8.3.3, I get the error:
iTunes Connect access for "Team-Name" is required. Add an account in the Accounts preference plane.
The account already exists and (in some cases) has been working without incident previously.
How do I get around this issue with Xcode so that I can upload my app to the AppStore?
Had the same problem,
First had to export the .ipa to disk using XCode and then upload to the AppStore with Application Loader tool.
It worked.
I suspect that Apple has broken something with the IOS 11, etc upgrades going on. It was all working fine over the last few months, including yesterday, and suddenly today its broken.
As a temporary solution, I had to use export to local disk (from Archive), then select: XCode/Open Developer Tool/Application Loader.
Had the same stupid problem.
Ultimately exported the .ipa to disk (via Xcode itself) and used altool command line tool to upload the ipa. It worked!!
altool --upload-app -f YourIpa.ipa -u <username>
Apple should really spend some $$$ on improving Xcode and the overall Developer experience. Its painful.
I again went back to Xcode to try and upload but met with the same error, so command line was indeed helpful.
A restart to Xcode did the job for me
I just spoke with an Apple rep, and he said I had to update to Xcode 9 GM and rebuild. After doing that, I was able to upload builds again.
On Xcode 9.3.3, a simple restart of Xcode fixed the issue for me.
This goes along with the other answers, eventually I had to export it and deliver the ipa with Application Loader.
However, Application Loader didn't initially work for me. I had to go into my apple id account (appleid.apple.com) and add an application specific password. Then I signed out of Application Loader and signed back in with the application specific password.
As far as I know, xCode doesn't let you sign in with an application specific password. My guess is that Apple broke authentication via regular passwords on their backend, but didn't break application specific ones.
It works for me to follow the steps:
Archive the app with Xcode 8.3.3.
Upload to iTunes Connect with Xcode 9 GM.
I started to panic this morning too, but then I remembered something like this happens every time a new iOS is released. Use Application Loader. Don't start changing certs/provisioning profiles. I'm sure Apple will fix soon. Plus Application Loader is super-easy to use. Good luck!
When nothing works. Just restart your computer and try again! Nonsense but works like magic.
Edit: This worked for me in Xcode 9 GM. I don't know if it will be an issue in the final version
What worked for me is that I changed my regular AppleID email, with the equivalent #icloud.com alias.
For example, I didn't use myemail#gmail.com, I used myemail#icloud.com and it worked.
(Which I really don't prefer, I prefer using my personal email, but if it works, it works)
Same answer here: https://stackoverflow.com/a/46225187/4772647
I did as some of you suggested, I used the Export function in Archive/Organizer to export an .ipa, then go to the Xcode application, use the Show Contents, then nav to "Application" and "Application Loader" and uploaded my app using Loader and that all worked perfectly!
This happened to me when my app was rejected when uploading on AppStore (not sure if this could be connected).
I tried to remove and readd the Developer's account in XCode but that didn't help.
Then it started working after I replied to the Binary Rejected message on App Store Connect and restarted XCode.
Not sure if that could be connected but it started working again instantly after those steps.
In My case none of the above solutions worked,
I have an access for both Developer account and iTunes Connect account, but I faced the same Issue.
The only option worked for me is updating my MAC OS before it was 10.13.4, after update to 10.13.6 the problem was resolved. Hope this will help to someone.

iOS - App not getting uploaded to Apple server

I have been trying to submit a Swift 3 app to Apple from Xcode 8.2 , App passes through all phases but gets stuck at authentication forever and then ends with an error. But then I export app for Appstore submission and then upload the same using Application Loader, tried with two different accounts but no avail. Have referred to this thread as well This action could not be completed. Try Again (-22421)
Most upvoted answer says apple servers may be misbehaving but I wonder how many days ? Is this something specific to Swift app ? I havent tried submitting any ObjC app recently so not sure, can anyone provide a solution ?
I stopped using Xcode uploader after 2 hours of failed uploading attempts. Then I took Application Loader instead and it told me the exact reason of fails. In my case it was too fat watch extension.
Hope this will help.
It's ongoing issue with Apple App uploader server, since couple of days, so you don't have a way, rather than waiting.
You can try following solutions:
Use Application Loader to upload your app, as Xcode organizer can't upload file (rejects IPA) sometimes, without genuine reason and it's frequently occurring issue, with Xcode Organizer, that apple could not resolve permanently.
Solution for error code: 22421
Apple app upload server is not working properly (not in
connection or lost connection during file upload). Just wait and try
again later (may be after a day).
Fluctuation in your network
connection, during file upload.
You may not have added privacy
statements in your info.plist file.
Cocoa Keys: Here, is list of keys that you should consider to add in your info.plist file, if you have used that service in your application.
Nowadays, you may also face, this error code: 90186 (with app loader)
Outdated application loader can be reason of this error. Use latest Xcode tool and use application loader from Xcode Tool.
Incorrect/invalid provisioning profile, associated with your build. Ensure, your have used correct provisioning profile (A provisioning
profile with Distribution/Production mode is require. A Development mode provisioning profile won't allow your to upload app on store.)
You can find latest Application Loader Tool from latest Xcode Tool: Xcode ▶ Open Developer Tool ▶ Application Loader

App doesn't work when downloaded from app store, but works in xcode

I've ran into quite an odd problem today. Today my app successfully got onto the app store. However, when I downloaded it I immediately noticed that the apps basic functionality wasn't working. It just hangs when trying to get outside information. I went back to my xcode project, ran it and it worked perfectly. I removed the app store version, and re-deployed the xcode version to my phone, and again it worked perfectly.
Did Apple do something to my code? The part that messes up seems to be a where my app creates a NSURLSESSION that is used to gather data from a website. Perhaps they "cleansed" the url strings that I use? This functionality that messes up is crucial to my app and hasn't been changed since I've submitted to the app store.
Anyone have any ideas why this is happening or how to fix this?
Thanks
Just posting the "solution":
Edit your Scheme and set the "Run" build configuration to "Release". After saving that, clean the project (cmd+shift+k) and run again on your device. By default, that will make you run the app in your device just as it will be ran when published in the AppStore.
And yes, unfortunately you will have to wait another week for Apple to aprove your app's new version as it will go through the review process again. Good luck! :)
For me it was that I was using old promocodes for testing.
That promocodes were from old version of the app (ios downloads app version that corresponds to promocode version), but I was expecting new functionality. So use latest promocodes!

App crashing - was accepted into app store

I've updated my app from iOS5/iPhone 4 to iOS6/iPhone5 compatible. The app was approved by the apple store and is available to download, when downloaded from the app store it crashes on start-up. However, installing the app from xcode onto devices works perfectly, I'm at a loss. I've attached a link for the crash report
any help would be most appreciated
http://pastebin.com/epgh2Jxv
Delete the app from your device completely, clean the product, then run again from xcode. I bet the problem comes out on yours too. It seems that a storyboard doesn't exist. You probably removed it by mistake but it is still existing cached in your product since Xcode doesn't actively go searching for old files to delete.

Resources