Fastboot flash system.img error

Lawiusz picture Lawiusz · Dec 15, 2015 · Viewed 41.8k times · Source

When I try to flash via fastboot system.img (from my custom AOSP build) to Sony Xperia Z3 I get the following error:

# fastboot flash system system.img 
sending 'system' (584106 KB)...
OKAY [ 18.294s]
writing 'system'...
FAILED (remote: size too large)
finished. total time: 18.297s

Z3 has about 2GB system partition and I have no idea why flashing fails.

Answer

tiger.meng picture tiger.meng · Dec 16, 2015

This forces fastboot to automatically sparse files to a given range in size K | M | G, in this case 256M

fastboot flash –S 256M system PATH_TO_SYSTEM.img