Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ubiquitousDocumentsDirectoryURL repeated crash #38

Closed
BobDG opened this issue Mar 30, 2014 · 14 comments
Closed

ubiquitousDocumentsDirectoryURL repeated crash #38

BobDG opened this issue Mar 30, 2014 · 14 comments
Labels
Milestone

Comments

@BobDG
Copy link

BobDG commented Mar 30, 2014

I don't have these crashes on my device but many users complain and I can see in TestFlight that there are many crashes, all this one:

*** -[NSFileManager createDirectoryAtURL:withIntermediateDirectories:attributes:error:]: URL is nil
SafeNotes -[iCloud ubiquitousDocumentsDirectoryURL] in iCloud.m on Line 158

Can I fix this in my own code? Or is this a bug in the framework?

@Sam-Spencer
Copy link
Member

I'll take a look at this and see what's going on. It looks like a bug from an older version has surfaced again. Ensure that your documents directory has been created in the iCloud App Sandbox.

@Sam-Spencer Sam-Spencer added the bug label Apr 1, 2014
@BobDG
Copy link
Author

BobDG commented Apr 2, 2014

Hi Sam, thanks for your answer. What do you mean exactly? Do I have to manually create the document before I save it with this framework? I already perform this check before using your framework:

NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *ubiquityURL = [fileManager URLForUbiquityContainerIdentifier:nil];
if (ubiquityURL) {
    // ....
}

Is this enough or should I check something else as well?

@Sam-Spencer Sam-Spencer changed the title Many crashes in iCloud.m line 158 ubiquitousDocumentsDirectoryURL Repeated Crash Apr 8, 2014
@Sam-Spencer Sam-Spencer changed the title ubiquitousDocumentsDirectoryURL Repeated Crash ubiquitousDocumentsDirectoryURL repeated crash Apr 8, 2014
@Sam-Spencer
Copy link
Member

Could you provide a little more information so that I can try to reproduce the issue? Is it happening on the first launch (eg. the first time iCloud is being setup with the app), or on a subsequent launch? What iCDS method is being called that triggers this?

@BobDG
Copy link
Author

BobDG commented Apr 9, 2014

Hi Sam,

What I see in iCloud and e-mails from angry users is it definitely keeps happening every time they launch the App, they can't use the App at all. From what I see in TestFlight:
APPNAME 0x000be025 -[iCloud ubiquitousDocumentsDirectoryURL] in iCloud.m on Line 158
APPNAME 0x000befcd -[iCloud saveAndCloseDocumentWithName:withContent:completion:] in iCloud.m on Line 283

Thanks for looking into this!

@Sam-Spencer
Copy link
Member

Hi @BobDG Could you please confirm that this is still an issue with the latest commit to the feature branch? Also, I apologize for taking way too long to get back to you.

@BobDG
Copy link
Author

BobDG commented Aug 4, 2014

Hi Sam,
No problem, I'm busy as well.
I'm actually not sure about whether the crashes are fixed now. In the end I had to set iCloud Sync default to 'Off' due to the many crashes. I'm a bit hesitant to set it to 'On' again by default. So I can't really give you a good answer but I'll try to investigate it and re-open this ticket if problems still arise, for now I'll believe you fixed it ;)

@BobDG BobDG closed this as completed Aug 4, 2014
@Sam-Spencer
Copy link
Member

@BobDG The latest update (version 7.4) definitely fixes this issue. I recommend taking a look at it and implementing the new setupiCloudDocumentSyncWithUbiquityContainer: method.

@BobDG
Copy link
Author

BobDG commented Jan 19, 2015

@Sam-Spencer Thanks! I think the podspec also needs to be updated to 7.4 still? Currently when running pod update it stays on 7.3...

@Sam-Spencer
Copy link
Member

@BobDG Yes, that is correct, the pod spec is now out of date. Sorry for the inconvenience. I'll update this when I get a chance later today. Happy coding!

@BobDG
Copy link
Author

BobDG commented Jan 20, 2015

@Sam-Spencer Thanks a lot for the update and all your work, greatly appreciated, will try to implement the update now :)

@BobDG
Copy link
Author

BobDG commented Jan 20, 2015

@Sam-Spencer Sorry, ran into another issue. The podspec file is updated but it seems that you haven't pushed the new podspec file to cocoapods itself using the 'trunk push' call. Is that correct? Cocoapods only has your 7.3 version.

@Sam-Spencer
Copy link
Member

@BobDG Yes, it seems that Cocoa Pods has completely changed since I last used it... Unfortunately, I no longer know how to push up changes in the pod spec. Last time I did this I just pushed some changes up to a GitHub repo and it worked. What needs to be done now? Could you provide some kind of instruction for this? Thanks!!

@BobDG
Copy link
Author

BobDG commented Jan 28, 2015

Hey Sam,

Yeah they switched from Pull Request to something way more easy :) You can now immediately update your pods without them needing to approve a pull request.
Instructions are very easy:

  • Open terminal
  • Navigate with 'cd' to the folder containing the .podspec file
  • type the following to validate your podspec file: pod spec lint
  • type the following to update your pod: pod trunk push (drag .podspec file here from Finder)

Let me know if it all worked out! :)

@Sam-Spencer
Copy link
Member

@BobDG Done and done! Thanks for pointers, much appreciated! I hope 7.4.1 works out for you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants