Friday 6 May 2016

Fixing Two Issues with iCloud sync not working with iBooks on iOS 9

Scenario One. You're busy creating an ePub. You make some changes and reload the book onto your iPad so you can view the changes. But when you try to open the book in iBooks, it barfs out an error message along the lines of, "Failed to load book because the requested resource is missing," and immediately closes the book.

What happened? You created a number of chapters, say chapter1.xhtml, chapter2.xhtml, and chapter3.xhtml. You flipped through the chapters until you were at chapter3.xhtml. Then you closed the eBook on your iPad and did some more work. In the course of your work you either deleted or renamed chapter3.xhtml. Even when you delete an eBook, your iPad remembers your place from last time you closed the book. So when you reload the book and try to open it, iBooks looks for the "missing" chapter, can't find it, has an existential crisis, and quits.

The solution. If you can remember the name of the file you renamed or deleted, create an empty file with the same name, reload the book on your iPad, and navigate away from the offending section of the book. If that doesn't work, try the fix for Scenario Two below.

Scenario Two. You're busy creating an ePub. You make some changes and reload the book onto your iPad so you can view the changes. But when you try to open the book in iBooks, you can't see any of the changes. You see an older version of the ePub.

What happened? I'm not 100% sure. Looks like under some circumstances even when you delete a book, iCloud keeps a local copy. Then when you try to load a new version of the book that it thinks is the same as the old version, it can't be arsed to actually load the new version and simply brings the old local copy back from the grave.

The solution.
  1. Change both a) the ePub filename; and b) the title of the book in the .opf file. (Yes, you have to do both or the workaround won't work.)
  2. Import the book into iBooks on Mac OS X as usual and sync to your iPad.
  3. Open the book and make sure the changes are present.
Oops, did you already use the final title of the book? Then you're screwed; you'll never be able to use it again without reverting to that earlier version. The only workaround: change the title to something you can live with, e.g. capitalize every word in the title, even prepositions (assuming you hadn't already done that; if so, do the opposite)

In terms of best practices, I'd suggest that until Apple fixes these issues (HA!) the best workaround is to constantly update the filename and book title. So if your book is called "Fubar," enter the title as "Fubar v.1" in the .opf file and call the file "foo.v.1.epub". Then whenever you make changes to the book, increment the version number in the title and the filename by 1 and reload onto your iPad. Hey, at least it works ...

11 comments:

  1. Thanks for this! You have explained the problem succinctly. I now understand why it is that only my iPod customers are having problems with EPubs that work EVERYWHERE else. The problem is laid squarely at iCloud's feet. Alas, but that clouds don't have feet. I test my EPubs on Nook and Kobo, my AZW3s on Kindle Fire. And this only after Calibre reports the books error free.

    How I feel about this is now as follows: "Too bad for iPad, glad I don't own one."

    But at least now I can explain why it isn't my fault. Thank's for the info. I feel much better.

    ReplyDelete
  2. I've spent past two days trying to find the problem. Eventually I've come to the conclusion it hasn't been I but iBooks itself that caused the issue.
    The weirdest thing is one is able to upload an updated version of a book when iCloud sync is off for iBooks. As soon as syncing has been enabled, iCloud removes my updated version and restores an older version EVEN THOUGH it has been deleted from all devices (including the cloud storage).

    Nice tip about renaming! Finally I managed to get a 'correct' version of a book on an iPad.

    ReplyDelete
    Replies
    1. Yes, whatever iCloud is doing is extremely annoying! Glad I could help!

      Delete
  3. Thank you! Thank you! Thank you! I've been working on this ebook for ages, modifying it and adding pages. It's loaded with pictures and text and really was my first creative endeavor. I've loaded various updated versions to iBooks over time and only recently (after upgrading to iOS 10) did it fail. I was perplexed and panic stricken. I had to use your Scenerio 2 and rename it with a version number but it works! Whew. I really thought I lost all that work and a pdf version was just not acceptable. You really saved my book, Richard.

    ReplyDelete
    Replies
    1. Happy that helped! I'm normally a big Apple fan, but I have to admit this has really tried my patience ...

      Delete
  4. Thank you! I downloaded an ePub online and being a pedant, I fixed the spelling of the author's name on iBooks – only to have two separate copies on my phone, neither one of which would open. Deleting both, changing the metadata title on Calibre, converting it to an ePub, then changing the title back to the original on iBooks worked fine. So everything looks as it should now. That was amazing.

    ReplyDelete
  5. Had this problem. After some frustration, I decided to put the original book back into iBooks and then loaded the updated verson. It solved the issue. Then I deleted the original version. The updated version still worked. I am much relieved.

    ReplyDelete
  6. Just deleting the Apple Books app from my device and reinstalling forced a fresh download of the new copy and solved the problem.

    ReplyDelete
    Replies
    1. Thank you for the tips. I managed to solve the issue the same way.

      Delete