4

I'm trying to build AOSP for non - supported device (surnia - Moto E2 2015 LTE).

I solved lots of problems earlier but now I have one that I can't avoid. I saw a lot of people had that problem, but their was just warning...

What can I do? Or could you help me finding surnia device tree (but for stock AOSP)?

[100% 441/441] writing build rules ...
FAILED: 
build/make/core/Makefile:28: error: overriding commands for target `out/target/product/surnia/system/vendor/lib/libHevcSwDecoder.so', previously defined at build/make/core/base_rules.mk:480
19:07:53 ckati failed with: exit status 1

#### failed to build some targets (01:22 (mm:ss)) ####
frogatto
  • 28,539
  • 11
  • 83
  • 129
PeterPkp123
  • 68
  • 2
  • 8

2 Answers2

3

add this flag "BUILD_BROKEN_DUP_RULES := true" in your BoardConfig.mk this work for me

2

I've recently encountered a similar error. It's because of a duplicate entry in PRODUCT_COPY_FILES which both are trying to copy some file to the same destination out/target/product/surnia/system/vendor/lib/libHevcSwDecoder.so. This will cause en error.

For me, the duplicate entry was in the following file:

<AOSP_ROOT>/vendor/google_devices/<DEVICE_CODENAME>/<DEVICE_CODENAME>-vendor-blobs.mk

For you, I think you should be looking for surnia-vendor-blobs.mk. Open this file and find the PRODUCT_COPY_FILES entry that has the destination out/target/product/surnia/system/vendor/lib/libHevcSwDecoder.so, then you can remove it to resolve the error.

This is a workaround, unfortunately I couldn't figout out what's the root problem.

by the way, Welcome Peter to Stack Overflow!

frogatto
  • 28,539
  • 11
  • 83
  • 129
  • But now, I have problem with... ```ninja: 'out/target/product/surnia/kernel', needed by 'out/target/product/surnia/boot.img', missing and no known rule to make it ``` – PeterPkp123 Dec 31 '19 at 11:52
  • @PeterPkp123 This error means that you should have a `device-common.mk` file in `/device/.../surnia/` that defines how to build/copy the kernel image for the device, but it sounds like that you don't have this make file or it doesn't have any recipe for `out/target/product/surnia/kernel`. – frogatto Dec 31 '19 at 12:05
  • Shoud I build kernel myself? I don't see any instructions in device.mk and no device-common.mk file ;/ – PeterPkp123 Dec 31 '19 at 12:39
  • @PeterPkp123 The kernel build tree isn't included in AOSP build tree. It's usually prebuilt and its image is in `/device/...` directory. – frogatto Dec 31 '19 at 17:34
  • I solved that problem, but I have new one :P ` FAILED: ninja: 'out/target/product/surnia/obj/KERNEL_OBJ/usr', needed by 'out/target/product/surnia/obj/EXECUTABLES/stml0xx_intermediates/STML0XX/stml0xx.o', missing and no known rule to make it 11:19:25 ninja failed with: exit status 1 #### failed to build some targets (03:35 (mm:ss)) #### ` Is there any way to solve it? I just don't know what to do, 100th error in that day :P – PeterPkp123 Jan 01 '20 at 11:30
  • @PeterPkp123 You actually shouldn't be fixing these errors, you should instead look for a full build tree that has make files to build AOSP for your device. Did you check out [LineageOS](https://github.com/LineageOS) build tree? Does it have make files for `surnia`? Also you can check [`android-prepare-vendor`](https://github.com/anestisb/android-prepare-vendor). – frogatto Jan 01 '20 at 12:26
  • I'm using now everything from lineageOS build trees. I checked every surnia device tree I think and Lineage had the smallest count of errors I downloaded vendor files, kernel, prebuild Kernel zImage and now I'm at the last step before processing that thousands of file when building... I don't know what to do, because surnia is not supported device now – PeterPkp123 Jan 01 '20 at 12:45
  • @PeterPkp123 Sorry, I don't know how to fix that error. – frogatto Jan 01 '20 at 12:50