Error when compiling for Kindle

First of all, I am not techie, so if you give me some techie response, I will not know how to use it. I cannot get my work to compile for Kindle. I’ve been able to just fine until this week. I had a MOBI file which Amazon can’t read, and when I tried to redo it, it gave me an error message that was so long I couldn’t even read to the bottom. This happens every time I use compile for Kindle. I tried uninstalling and reinstalling KindleGen, but that didn’t do anything. I’m stuck and I really don’t understand any of the software stuff. I need step-by-step help on how to resolve this.

Now I’m getting this error message:


Amazon kindlegen(Windows) V2.9 build 1029-0897292
A command line e-book compiler
Copyright Amazon.com and its Affiliates 2014


Info(prcgen):I1047: Added metadata dc:Title “Electricity”

Info(prcgen):I1047: Added metadata dc:Date “2014-11-21T21:10:49+19:00”

Info(prcgen):I1047: Added metadata dc:Creator “nn”

Info(prcgen):I1047: Added metadata dc:Contributor “Scrivener for Windows (1.7.2.0) [literatureandlatte.com/scrivenerforwindows/]”

Info(prcgen):I1002: Parsing files 0000004

Info(prcgen):I1015: Building PRC file

Info(prcgen):I1006: Resolving hyperlinks

Info(prcgen):I1008: Resolving start reading location

Info(prcgen):I1049: Building table of content URL: C:\Users\nn\AppData\Local\Temp\mbp_7DE_B_15_10_A_33_1C1_162C_1244_1\OPS\toc.ncx

Info(pagemap):I8000: No Page map found in the book

Okay, first off, are you getting the error in Scrivener when you’re trying to compile the mobi file, or does it seem to compile correctly but then give you an error when you open it in Kindle Previewer or the Kindle Reader software or on your physical Kindle? I’m assuming the former, that it’s an error when creating the file, but since you also mentioned Amazon being unable to read a file I want to be clear.

In Scrivener, please check Help > About Scrivener and make sure that at the bottom it says you’re using version 1.7.3. I know an adjustment was made in one of the most recent updates to show the full KindleGen error report if one came during compile, so I’d like first off to check whether you are in fact using the latest version of Scrivener. If you’re on anything earlier than 1.7.3, you should be able to use Help > Check for Updates to download and install 1.7.3. If that doesn’t work, you can instead close Scrivener and then download the 1.7.3 installer directly from the webpage here. You can install it over your existing version, if you wish.

Using version 1.7.3, could you then try the mobi compile and take a screenshot of the error message you are receiving? Use the PrintScreen key on your keyboard to take the snapshot, then paste into MS Paint and save as a file to attach here or email it to windows.support AT literatureandlatte DOT com with a reference to this forum post.

If you’d like, you can also send a zipped copy of the project to that address, Attn: Jennifer, and I will take a look at it directly to see what may be causing the error. Your project will remain confidential, of course; this will just give me a chance to see exactly what compile settings are in use and how the project is structured and check for any stray invisible characters or such that could be causing problems. To send the project, use File > Back Up > Back Up To… in Scrivener with the “Backup as ZIP file” option ticked and save the backup to the Desktop or somewhere convenient, then attach that to your email.

EDIT: Just saw your latest post. None of the items in that are an error, they’re just the general info logs created as part of KindleGen converting the epub file to mobie, part of the compile process. Is that a complete list? Where are you getting the message?

I’m using the latest update to Scrivener. The message I posted clearly said at the top “The following error occurred,” so it’s definitely an error message, and it doesn’t generate a MOBI file at the end. When it compiles correctly, I get a message saying it’s compiled.

I don’t know why Amazon couldn’t read the file; that’s never happened before. It seems to be this one specific file because every other file I’ve compiled works fine–I even tested it with a different document. The only thing I found that made any difference was changing the size of the cover image, which makes no sense–all my other cover images are exactly the same size.

Okay, possibly the full error message isn’t showing then for some reason, and I’ll check into that. It’s not really relevant to fixing your problem though so it can wait.

Are you able to successfully compile to the epub format? Scrivener creates a mobi by first creating an epub and then running that through KindleGen, so it would be helpful to know where the error is occurring, in the epub generation or the conversion to mobi.

Dear support members,

as Windows user I have exactly the same problem with compiling to mobi and I am trying to solve it since weeks without any chance to succeed alone. I am working like a bug fixing departement, but no chance. :open_mouth:

With your hint to try first to export as Epub I tried that and found out that:

a) if you export to Epub all is fine!

b) If you open the Epub after that with my installed Kindle Previewer the Previewer uses (a) Kindlegen to convert the Epub into mobi… and all is converted fine without errors…
very strange… so I think there is a problem in Scrivener with the converting to mobi?!

I don´t know how to fix it, but finally I am able to go the way over Epub by the Kindle Previewer. But ok, that´s not what Scrivener is built for, no?! :wink:

By the way, I have two further problems with exporting:

  1. When exporting my project there is always missing the first text doc of a folder in the “Contents” list! The rest appears correctly in the list.

  2. How can I change the name “Contents” (Windows version)? For a German book “Contents” is not really perfect. :wink:

I hope you can help me. Lots of greetings from Germany :slight_smile:

To create mobi files, Scrivener compiles to epub, then runs that through Amazon’s KindleGen. Since the conversion is working correctly in Amazon Previewer, which uses its own copy of KindleGen, the first thing to rule out is that your KindleGen download is corrupted. I’d try just deleting that and redownloading a fresh copy from Amazon’s KDP page, here. Unzip that and move the “kindlegen.exe” program to wherever you want to keep it on your computer, then in Scrivener’s “KindleGen” tab in compile, browse to locate the new kindlegen program and OK that. Then try the compile again.

The usual reason that an item doesn’t appear in the Contents list is that it is not contained inside the Draft folder. In your binder, is the missing document at the same level (indentation) as the other items that do appear, and inside the Draft folder? If that looks right, check that your compile contents list is the entire Draft folder, not just a subitem. At the top of the contents list there is a drop-down menu; make sure that says “Draft”. The Draft folder may be renamed, but it usually has an icon like this:WinDraftIcon.png

Currently the table of contents is auto-generated during compile, so to edit it and change the text, you’ll need to use an epub editor like the free [code.google.com/p/sigil/]Sigil[/url]. Compile to epub from Scrivener, open it in Sigil and make whatever changes you want directly in the editor there (there’s a WYSIWYG editor so it’s quite simple), then resave and use Kindle Previewer to create the .mobi copy.

Dear Jennifer, thank you for your help :slight_smile:

I will try to post some screenshots for you, for better understanding. Concerning the mobi problem I downloaded the kindlegen again (for the 4th time maybe already) and it never changes anything.
There is always the same error (no page-map found). See the screenshot13 on the end.

But exporting to Epub works fine now. So actually I use the Kindle Previewer to convert and that works. It is not what I expect from Scrivener, but for the moment I have this solution.

My last real problem is still the missing first title of a folder in the contents table.

The folders are subfolders of my draft folder. In fact it is a poems book and I made “year” folders as subfolders of “draft” and inside the year folders there are my poems docs and docs with photos included.

I tried really a lot and found out that always if you choose a “line space” between a folder and the first doc of the folder, then the first doc title does NOT appear in the “contents” table.

But if you choose “page break” between folder and first text doc, then the title of the doc appears in the “contents” table.
But unfortunately “page break” is not what I want because with a page break you have the number of the “year” alone on one site and on the next site the poem. On the book´s page I want the “year” folder title directly above my poems title - with one line space.

Screenshot_Scrivener-12.jpg

For the changing of “Contents” to the german word “Inhalt” I tried your hint for using Sigil or Calibre and it worked fine :slight_smile: Thank you! :slight_smile:

Nevertheless I can´t wait for further updates of the Windows version because I always see a lot of more layout options in the MAC version already :wink:

I wish you and the team a merry christmas time and holidays!!!
:slight_smile:

Thanks for the additional detail. I had misunderstood what you were describing about the missing title and thought the document was not appearing in Scrivener’s content list for compile. I see you’re talking about the automatically generated table of contents in the ebook. As you’ve discovered, the table of contents is created by taking the the title of each document that follows a set page break. Page breaks come either from the “page break” separator as you indicated in the screenshot or from the “page break before” setting that can be ticked for any document (overriding the separator that would normally precede it). How you want this set up depends on your binder structure.

In your case, since you’re trying to make two documents’ titles appear on the same page, you may have to get a little more creative. Do you have multiple poems that need to use the same year in their title? Could you add the year directly to each document’s title or structure the binder so that the documents of each year sit at a different level and then use the title prefix in compile to add the year as a line preceding the title? (You’d need different levels in the binder so you could have distinct prefixes.) Adding the year to the title or as a prefix would cause it to appear also in the table of contents for each title, but you could also edit that out in Sigil if you didn’t want it to appear there.

The info messages you’re seeing when compiling to .mobi are just produced by KindleGen, so this is identical to opening the compiled epub in Amazon Previewer and using its KindleGen to convert the file. None of the messages there are errors or warnings; they are all “info” as you can see at the start of each line. I’ll check into why Scrivener is reporting the creation log here with that message, but meanwhile you should be able to click OK to close it and open the .mobi file in Previewer without issue. That said, if you need to adjust the text in Sigil after compile, you’ll need to compile just to epub first anyway. I’m not aware of any programs that can edit the .mobi package.

Thank you so much Jennifer for your nice reply and help! :slight_smile:
(since weeks I try to solve my problems and I am creatively blocked since weeks all the time)

Yes, I was talking about the automatically generated table of contents in the eBook. :slight_smile:
I structured my binder logical as follows to have a good overview and wanted the same for the reader in the eBook and automatically generated table of contents.

Screenshot_Scrivener-11.jpg

But the “year-title” should only appear “once” on top of the page of the first poem in this year and “once” in the table of contents to structure it by years… in fact I thought of structure my book by years so the reader could follow a development through out the years (maybe) :wink:

in fact the year would be once the “chapter” (folder) and the “poems titles” would be sub-chapters (the docs in the folder)… that was my thiking :wink:

But now I got new ideas from you and I will try to play around again with your hints, but I am not sure if that could work for me - we will see :wink:

for the mobi problem…
always when I get this message (you said there are no errors reported), after clicking OK there is never a mobi file created. therefore I talked about an error message…
you are always thrown back to the compiling area and can continue like that for hours…
I never succeed to get a mobi… only the Epub is created correctly, but never a mobi file :cry:

greetings from Germany, Bernd

Concerning my “table of content” problem in fact I only need a button or option in Scrivener to classify a word (or sentence or whatever) to appear in the table of contents. That´s all.
For example like you can do it in Word by classifying something as “heading/title”.
:smiley: