java.io.IOException: insufficient bytes written to stream

Please provide a repro case. If possible, zip the project and share it.

Another thing to check is if it works with an empty project?