Hello everyone! So I wanted to build my game on my phone, but it doesn’t go well since I get these errors :
java.io.IOException: insufficient bytes written to stream
Expected content length differs from actually streamed for resource /build/_generated_332be63.texturec (11184965 != 14986053)
Could not instantiate game object from prototype /_generated_4862be8a.goc.
Also dmengine on my phone crashes.
Sorry if it was unclear. I’ve tried to build my game from defold’s editor to android device using dmengine. I selected my phone on target device and hit “build”. After few minutes of waiting I got these errors :
java.io.IOException: insufficient bytes written to stream ;
Expected content length differs from actually streamed for resource /build/_generated_332be63.texturec (11184965 != 14986053)
Could not instantiate game object from prototype /_generated_4862be8a.goc.
And dmengine on my phone also crashed. Tried few more times but didn’t achieve anything.
The message comes from inside the engine, and it’s in response to the http request it does to the editor.
In this case the http headers said the file is 11184965 bytes, but the POST data ended up streaming 14986053 bytes.
It would be beneficial if you could share a small repro case that we can debug.
When I selected to launch on controller collection it successfully launched until I pressed “start” button to load main collection, then after a few minutes it crashed.
EDIT: Tried to build side scroller tutorial and it worked.
The size of the atlas in bytes is widthheight4 (one byte per color):
8192*8192*4=268Mb
And you will have mipmaps on top of that (unless you disable them using texture profiles) which adds about 33% more. The final texture that you try to stream to your phone and then upload to the GPU is approximately 350Mb. That is a lot of data, and most phone GPUs won’t be able to handle 8k textures.
You need to reduce the texture size to something more reasonable. Preferably not above 2048x2048.