[Android Q&A, Help & Troubleshooting] Demoxing:
Hello guys, facing this error while comping the rom.

Any suggestions on how do I fix this??

Building PE rom.

++++ system ++++

creating system.img...
Running: mkuserimg_mke2fs.sh -s /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/SYSTEM /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/IMAGES/system.img ext4 system 1536000512 -j 0 -T 1230748200 -C /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/META/filesystem_config.txt -B /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/IMAGES/system.map -L system -M 0 -U 273ec7de-1500-51e5-9c8c-d251694ef6ac -S 55faa1c1-4e7b-5e3a-81aa-1b593b87847a /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/META/file_contexts.bin
MKE2FS_CONFIG=./system/extras/ext4_utils/mke2fs.conf E2FSPROGS_FAKE_TIME=1230748200 mke2fs -O ^has_journal -L system -m 0 -U 273ec7de-1500-51e5-9c8c-d251694ef6ac -E android_sparse,hash_seed=55faa1c1-4e7b-5e3a-81aa-1b593b87847a -t ext4 -b 4096 /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/IMAGES/system.img 375000
mke2fs 1.43.3 (04-Sep-2016)
Creating filesystem with 375000 4k blocks and 93888 inodes
Filesystem UUID: 273ec7de-1500-51e5-9c8c-d251694ef6ac
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done

E2FSPROGS_FAKE_TIME=1230748200 e2fsdroid -T 1230748200 -C /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/META/filesystem_config.txt -B /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/IMAGES/system.map -S /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/META/file_contexts.bin -f /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/SYSTEM -a /system /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/IMAGES/system.img
__populate_fs: Could not allocate block in ext2 filesystem while writing file "framework-res.apk"
e2fsdroid: Could not allocate block in ext2 filesystem while populating file system
Error: '['mkuserimg_mke2fs.sh', '-s', '/home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/SYSTEM', '/home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/IMAGES/system.img', 'ext4', 'system', '1536000512', '-j', '0', '-T', '1230748200', '-C', '/home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/META/filesystem_config.txt', '-B', '/home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/IMAGES/system.map', '-L', 'system', '-M', '0', '-U', '273ec7de-1500-51e5-9c8c-d251694ef6ac', '-S', '55faa1c1-4e7b-5e3a-81aa-1b593b87847a', '/home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/META/file_contexts.bin']' failed with exit code 4:
MKE2FS_CONFIG=./system/extras/ext4_utils/mke2fs.conf E2FSPROGS_FAKE_TIME=1230748200 mke2fs -O ^has_journal -L system -m 0 -U 273ec7de-1500-51e5-9c8c-d251694ef6ac -E android_sparse,hash_seed=55faa1c1-4e7b-5e3a-81aa-1b593b87847a -t ext4 -b 4096 /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/IMAGES/system.img 375000
mke2fs 1.43.3 (04-Sep-2016)
Creating filesystem with 375000 4k blocks and 93888 inodes
Filesystem UUID: 273ec7de-1500-51e5-9c8c-d251694ef6ac
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done

E2FSPROGS_FAKE_TIME=1230748200 e2fsdroid -T 1230748200 -C /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/META/filesystem_config.txt -B /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/IMAGES/system.map -S /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/META/file_contexts.bin -f /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/SYSTEM -a /system /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/IMAGES/system.img
__populate_fs: Could not allocate block in ext2 filesystem while writing file "framework-res.apk"
e2fsdroid: Could not allocate block in ext2 filesystem while populating file system

Out of space? The tree size of /home/demoxing/pe/out/target/product/hammerhead/obj/PACKAGING/target_files_intermediates/aosp_hammerhead-target_files-eng.demoxing/SYSTEM is 1526571008 bytes (1455 MB), with reserved space of 0 bytes (0 MB).
The max image size for filsystem files is 1536000512 bytes (1464 MB), out of a total partition size of 1536000512 bytes (1464 MB).
Traceback (most recent call last):
File "build/make/tools/releasetools/add_img_to_target_files", line 824, in <module>
main(sys.argv[1:])
File "build/make/tools/releasetools/add_img_to_target_files", line 818, in main
AddImagesToTargetFiles(args[0])
File "build/make/tools/releasetools/add_img_to_target_files", line 727, in AddImagesToTargetFiles
output_zip, recovery_img=recovery_image, boot_img=boot_image)
File "build/make/tools/releasetools/add_img_to_target_files", line 150, in AddSystem
block_list=block_list)
File "build/make/tools/releasetools/add_img_to_target_files", line 281, in CreateImage
assert succ, "build " + what + ".img image failed"
AssertionError: build system.img image failed
ninja: build stopped: subcommand failed.
14:58:53 ninja failed with: exit status 1

#### failed to build some targets (05:03 (mm:ss)) ####