[X Play Q&A, Help & Troubleshooting] arnabJ:
Hello, I am trying to build Android 7.0 AOSP for our Moto X Play.

This is my 1st time and I am running into various problems. While I have been able to fix few of them, this particular problem is out of my understanding.

Starting build with ninja
ninja: Entering directory `.'
ninja: error: 'out/target/product/lux/obj/KERNEL_OBJ/usr', needed by 'out/target/product/lux/obj/EXECUTABLES/audiod_intermediates/audiod_main.o', missing and no known rule to make it
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

I have attached my local-manifest and default.xml files for reference.

[MENTION=6485916]squid2[/MENTION] , [MENTION=4910973]Vatsal[/MENTION] , [MENTION=5293805]GtrCraft[/MENTION] , [MENTION=6779733]TechnoAnder[/MENTION] , [MENTION=4793981]nickdoherty[/MENTION] please check if any one of you can help. I am sorry for tagging you all to the post like this. But I really want to be able to successfully build the ROM for our device.

Point out my mistakes if any in local-manifest and also comment if you need any more info to be able to help me fix the issue.

Update 1 : I tried with just "make" and at last got this :

build/core/Makefile:34: warning: overriding commands for target `out/target/product/lux/system/bin/rild'
build/core/base_rules.mk:316: warning: ignoring old commands for target `out/target/product/lux/system/bin/rild'
build/core/Makefile:34: warning: overriding commands for target `out/target/product/lux/system/lib/libril.so'
build/core/base_rules.mk:316: warning: ignoring old commands for target `out/target/product/lux/system/lib/libril.so'
build/core/Makefile:34: warning: overriding commands for target `out/target/product/lux/system/lib/hw/audio.primary.default.so'
build/core/base_rules.mk:316: warning: ignoring old commands for target `out/target/product/lux/system/lib/hw/audio.primary.default.so'
build/core/Makefile:34: warning: overriding commands for target `out/target/product/lux/system/lib/hw/audio.primary.msm8916.so'
build/core/base_rules.mk:316: warning: ignoring old commands for target `out/target/product/lux/system/lib/hw/audio.primary.msm8916.so'
build/core/Makefile:34: warning: overriding commands for target `out/target/product/lux/system/lib/hw/audio_policy.default.so'
build/core/base_rules.mk:316: warning: ignoring old commands for target `out/target/product/lux/system/lib/hw/audio_policy.default.so'
build/core/ninja.mk:163: recipe for target 'out/build-aosp_lux.ninja' failed
make: *** [out/build-aosp_lux.ninja] Segmentation fault (core dumped)
make: *** Deleting file 'out/build-aosp_lux.ninja'

Update 2 : Trying again gave different error :

build/core/Makefile:34: warning: overriding commands for target `out/target/product/lux/system/bin/rild'
build/core/base_rules.mk:316: warning: ignoring old commands for target `out/target/product/lux/system/bin/rild'
build/core/Makefile:34: warning: overriding commands for target `out/target/product/lux/system/lib/libril.so'
build/core/base_rules.mk:316: warning: ignoring old commands for target `out/target/product/lux/system/lib/libril.so'
build/core/Makefile:34: warning: overriding commands for target `out/target/product/lux/system/lib/hw/audio.primary.default.so'
build/core/base_rules.mk:316: warning: ignoring old commands for target `out/target/product/lux/system/lib/hw/audio.primary.default.so'
build/core/Makefile:34: warning: overriding commands for target `out/target/product/lux/system/lib/hw/audio.primary.msm8916.so'
build/core/base_rules.mk:316: warning: ignoring old commands for target `out/target/product/lux/system/lib/hw/audio.primary.msm8916.so'
build/core/Makefile:34: warning: overriding commands for target `out/target/product/lux/system/lib/hw/audio_policy.default.so'
build/core/base_rules.mk:316: warning: ignoring old commands for target `out/target/product/lux/system/lib/hw/audio_policy.default.so'
*** glibc detected *** out/host/linux-x86/bin/ckati: free(): invalid next size (fast): 0x0000000055536890 ***
======= Backtrace: =========
[0x4946c2]
[0x42e3d8]
[0x42dc46]
[0x42c9db]
[0x477c44]
[0x4032c1]
======= Memory map: ========
00400000-00584000 r-xp 00000000 08:04 777269 /media/arnabj/Firmwares/AndroidSource/Nougat/out/host/linux-x86/bin/ckati
00584000-0058d000 rw-p 00183000 08:04 777269 /media/arnabj/Firmwares/AndroidSource/Nougat/out/host/linux-x86/bin/ckati
0058d000-005a8000 rw-p 00000000 00:00 0
02260000-5d875000 rw-p 00000000 00:00 0 [heap]
7f16f0000000-7f16f2403000 rw-p 00000000 00:00 0
7f16f2403000-7f16f4000000 ---p 00000000 00:00 0
7f16f8000000-7f16fac00000 rw-p 00000000 00:00 0
7f16fac00000-7f16fc000000 ---p 00000000 00:00 0
7f16fc000000-7f16fe400000 rw-p 00000000 00:00 0
7f16fe400000-7f1700000000 ---p 00000000 00:00 0
7f1700000000-7f1703401000 rw-p 00000000 00:00 0
7f1703401000-7f1704000000 ---p 00000000 00:00 0
7f1706e4e000-7f1706e4f000 ---p 00000000 00:00 0
7f1706e4f000-7f170764f000 rw-p 00000000 00:00 0
7f170764f000-7f1707650000 ---p 00000000 00:00 0
7f1707650000-7f1707e50000 rw-p 00000000 00:00 0
7f1707e50000-7f1707e51000 ---p 00000000 00:00 0
7f1707e51000-7f1708651000 rw-p 00000000 00:00 0
7f1708651000-7f1708652000 ---p 00000000 00:00 0
7f1708652000-7f170a257000 rw-p 00000000 00:00 0
7f170a2be000-7f170a6bf000 rw-p 00000000 00:00 0
7f170aab8000-7f170acb3000 rw-p 00000000 00:00 0
7f170ad13000-7f170ad15000 rw-p 00000000 00:00 0
7ffc0370b000-7ffc03746000 rw-p 00000000 00:00 0 [stack]
7ffc0379b000-7ffc0379d000 r--p 00000000 00:00 0 [vvar]
7ffc0379d000-7ffc0379f000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
build/core/ninja.mk:163: recipe for target 'out/build-aosp_lux.ninja' failed
make: *** [out/build-aosp_lux.ninja] Aborted (core dumped)
make: *** Deleting file 'out/build-aosp_lux.ninja'

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

Update 3 : The above error only comes up when do "make", may be my pc's resources get exhausted? doing "make -j4" gives the initial error again. So I manually created these three directories : obj, KERNEL_OBJ, usr and restarted with "make -j4".

To my surprise this time it didn't gave this error anymore. Instead it gave :

Starting build with ninja
ninja: Entering directory `.'
ninja: error: 'out/target/product/lux/obj/SHARED_LIBRARIES/libcryptfs_hw_intermediates/export_includes', needed by 'out/target/product/lux/obj/EXECUTABLES/vold_intermediates/import_includes', missing and no known rule to make it
build/core/ninja.mk:148: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

When serached on Google regarding this I came to find out that I have missed "device/qcom/common/" and so updated my local-manifest and sync'd it. Even though now I have the device tree I still get the same error.