Corrupt Word Compile from V3 project

On this thread:

viewtopic.php?p=257245#p257245

I had previously set up a test project to show how to get Heading 1-3 styles exported from Scrivener to Word, using Section Layouts with Styles “Heading X” assigned to the titles. It used to work. I just downloaded that project and tried to compile it in 3.09 to confirm it still works, but compilation gives me this when trying to load the docx file into Word V16.18:

Screenshot 2018-10-30 at 08.23.56_SMALL.png

If you try to load it anyway (click yes), headings are not styled any more. There must be something in this project that is triggering the compile issue for DOCX, it seems RTF export is OK. I tried creating a new project and the same problem occurs, so it doesn’t only occur in older saved projects. My version of Word is also newer than when I wrote that post so I don’t know whether Scrivener is doing something different or Word is.

Please find .scriv and resultant docx attached:

Heading Test.zip (93.9 KB)

Given the “unreadable content” part of the warning message, I’d quickly try “zap gremlins” on the whole draft to see if that’s the problem.

I don’t think that’s the problem though, because the odd thing is that when I compile your sample project I get what appears to be a cleaner .docx file. I’m not testing with Word, but with Pages, LibreOffice and NWP. The .docx in your zip does indeed lack stylesheets in all three programs. None of them had any troubles opening the file, but no styles. So I compiled, and my .docx has styles. I’m attaching it to see if you get an error in Word.

How are you set up in the Sharing: Conversion preference pane? One thing I can think of is that the conversion engine has been updated, and may not work right with older system Java installs.
styles.zip (13 KB)

I see styles in your attached word file just fine (looks like an RTF saved as a docx)

Screenshot 2018-10-30 at 21.41.35_SML.png

No system Java being used, so I think it should be fine. I attach a brand new project created fresh (from blank, again using Modern compile format) in 3.09, gremlins zapped, and still no styles in Word (or LibreOffice).

Heading Test 2.zip (28.2 KB)

This happens on both my iMac and Macbook, so if it is a setting then it is shared across machines.I wonder what else is triggering this?

Strange, when I unzip the .docx I attached it looks like a normal DOCX directory and file structure to me, not a renamed RTF.

Well that aside, I had a closer look at the .docx file you sent and it is definitely not generated by the Java converter. Rather this is what a .docx file looks like when the Cocoa exporter is involved—and that will be the natural fall-back to use if for some reason enhanced converter fails. So, that is a strong indication that the Java environment in Scrivener may not be working right with your machine(s).

I’d compile with Console open and look for any messages relating to Aspose.

This could be a good catch. The Java environment has been completely updated internally. We needed to do that anyway, but new certification standards required urgently switching to another distribution, so we’re using OpenJDK now.

Yes, there is an Aspose failure, though I can see no console messages for Java itself:

fault	07:34:11.429435 +0800	Scrivener	RETURNING UnknownFS PLACEHOLDER: <private>
fault	07:34:11.441002 +0800	Scrivener	RETURNING UnknownFS PLACEHOLDER: <private>
fault	07:34:11.456801 +0800	Scrivener	RETURNING kUTTypeApplication PLACEHOLDER: <private>
default	07:34:12.441578 +0800	Scrivener	Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default	07:34:12.441669 +0800	Scrivener	Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default	07:34:18.404838 +0800	Scrivener	Connection to sharingd became invalid
error	07:34:18.537082 +0800	Scrivener	errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo={NSLocalizedDescription=query cancelled}
default	07:34:18.537208 +0800	Scrivener	OSErr AERemoveEventHandler(AEEventClass, AEEventID, AEEventHandlerUPP, Boolean)(ficl,askM handler=0x7fff495f2c9e isSys=NO) err=0/noErr
default	07:34:18.645717 +0800	Scrivener	Adding presenter DA4326CB-9EDE-4DFA-BF56-43926BEA39D7 for URL: <private>
default	07:34:19.258917 +0800	Scrivener	*** Failed to create file using Java Aspose converters; falling back on standard NSText exporters.
default	07:34:20.216755 +0800	Scrivener	Making presenter DA4326CB-9EDE-4DFA-BF56-43926BEA39D7 observe change
default	07:34:20.216846 +0800	Scrivener	Making presenter DA4326CB-9EDE-4DFA-BF56-43926BEA39D7 observe change
default	07:34:20.222206 +0800	Scrivener	Removing presenter DA4326CB-9EDE-4DFA-BF56-43926BEA39D7
default	07:34:21.051089 +0800	Scrivener	27366555: RECEIVED OUT-OF-SEQUENCE NOTIFICATION: 0 vs 210, 513, <private>
default	07:34:21.426965 +0800	Scrivener	Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default	07:34:21.427052 +0800	Scrivener	Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default	07:34:21.427111 +0800	Scrivener	Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default	07:34:21.427164 +0800	Scrivener	Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default	07:34:21.427217 +0800	Scrivener	Making presenter 30431685-903F-4957-859D-D833C7704BF2 observe change
default	07:34:22.479724 +0800	Scrivener	LSExceptions shared instance invalidated for timeout.

There is a kernel related error for [java] that is triggered immediately before Scrivener logs its message, here are two repeated failures, both logged as code signing issues:

default	07:34:19.246407 +0800	kernel	CODE SIGNING: 22437[java] vm_map_enter: curprot cannot be write+execute. failing
default	07:34:19.258917 +0800	Scrivener	*** Failed to create file using Java Aspose converters; falling back on standard NSText exporters.
default	07:33:05.360624 +0800	kernel	CODE SIGNING: 22093[java] vm_map_enter: curprot cannot be write+execute. failing
default	07:33:05.377506 +0800	Scrivener	*** Failed to create file using Java Aspose converters; falling back on standard NSText exporters.


-----------------

EDIT: if I try to run java on the command line from the app bundle it fails (and I see the same kernel error message in console too):

/Applications/Scrivener.app/Contents/Resources/jre/bin
❯ ./java
Error occurred during initialization of VM
Could not reserve enough space in CodeHeap 'non-nmethods' (2496K)

But not for V3.03 where there is no kernel error or command line error (and 3.03 exports styles just fine using my latest test project):

~/Desktop/Scrivener303.app/Contents/Resources/jre/bin
❯ ./java
Usage: java [-options] class [args...]
           (to execute a class)
   or  java [-options] -jar jarfile [args...]
           (to execute a jar file)

Could you please confirm that this version of Scrivener works fine?

literatureandlatte.com/dlbet … x-test.zip

It seems that the problem is Apple’s new notarisation requirements, which necessitate forcing a hardened runtime on the Java files. This, in turn, seems to prevent them from working on many computers. The above version does not force a hardened runtime on the Java files (and thus will not pass Apple’s notarisation requirements). It looks as though I may need to take this up with Apple.

EDIT: Could you please specify which version of macOS you are running?

Yes, that build seems to work. I’m using 10.14 build 18A391 on an iMac 16,2 and a Macbook Pro 11,5 — I will try the 10.14.1 update and see if it fixes anything…

I’m getting that same issue.
Word will open the file once you recover it. I can then resave to a working .docx.
Should I try the test build or just wait?
Rory
Oh, Macbook (latest one), 10.14.1, up-to-date Word 365