Build Android failed

Thank you! It works now!

I still get error…

Makefile:133: recipe for target ‘sub-make’ failed
make: *** [sub-make] Error 2
make: Leaving directory ‘/media/gytis/raid2tb/gytis/development/git-files/khadas/android-7/common’
[ 11% 5410/47622] target Java: core-oj (out/target/common/obj/JAVA_LIBRARIES/core-oj_intermediates/classes)
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
[ 11% 5410/47622] build out/target/common/obj/JAVA_LIBRARIES/sdk_v16_intermediates/classes.jack
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target ‘ninja_wrapper’ failed
make: *** [ninja_wrapper] Error 1

make failed to build some targets (21:26 (mm:ss))

Or this one:

1 warning generated.
[ 67% 32013/47622] target thumb C++: libamnuplayer_32 <= vendor/amlogic/frameworks/av/media/Am-NuPlayer/AmNuPlayer.cpp
vendor/amlogic/frameworks/av/media/Am-NuPlayer/AmNuPlayer.cpp:547:45: warning: ISO C++11 does not allow conversion from string literal to ‘char *’ [-Wwritable-strings]
mStrCurrentAudioCodec = “DTSHD”;
^
vendor/amlogic/frameworks/av/media/Am-NuPlayer/AmNuPlayer.cpp:648:49: warning: ISO C++11 does not allow conversion from string literal to ‘char *’ [-Wwritable-strings]
mStrCurrentAudioCodec = “DTSHD”;
^
vendor/amlogic/frameworks/av/media/Am-NuPlayer/AmNuPlayer.cpp:575:30: warning: comparison of integers of different signs: ‘size_t’ (aka ‘unsigned int’) and ‘int’ [-Wsign-compare]
for (size_t i = 0; i < track_num; i++) {
~ ^ ~~~~~~~~~
vendor/amlogic/frameworks/av/media/Am-NuPlayer/AmNuPlayer.cpp:609:23: warning: comparison of integers of different signs: ‘size_t’ (aka ‘unsigned int’) and ‘ssize_t’ (aka ‘int’) [-Wsign-compare]
if (i == mSource->getSelectedTrack(MEDIA_TRACK_TYPE_VIDEO)) {
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vendor/amlogic/frameworks/av/media/Am-NuPlayer/AmNuPlayer.cpp:644:23: warning: comparison of integers of different signs: ‘size_t’ (aka ‘unsigned int’) and ‘ssize_t’ (aka ‘int’) [-Wsign-compare]
if (i == mSource->getSelectedTrack(MEDIA_TRACK_TYPE_AUDIO)) {
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target ‘ninja_wrapper’ failed
make: *** [ninja_wrapper] Error 1

make failed to build some targets (48:19 (mm:ss))

Not sure, it kind of keeps failing on random places:

[ 67% 31955/47622] target SharedLib: libamffmpeg_32 (out/target/product/kvim/obj_arm/SHARED_LIBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so)
FAILED: /bin/bash out/target/product/kvim/obj_arm/SHARED_LIBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so.rsp
clang++: error: unable to execute command: Aborted
clang++: error: linker command failed due to signal (use -v to see invocation)
[ 67% 31955/47622] target arm C++: libamffmpegadapter_32 <= vendor/amlogic/frameworks/av/AmFFmpegAdapter/utils/AmFFmpegByteIOAdapter.cpp
vendor/amlogic/frameworks/av/AmFFmpegAdapter/utils/AmFFmpegByteIOAdapter.cpp:179:50: warning: unused parameter ‘thiz’ [-Wunused-parameter]
int32_t AmFFmpegByteIOAdapter::staticWrite(void* thiz, uint8_t* buf, int amt) {
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/utils/AmFFmpegByteIOAdapter.cpp:179:65: warning: unused parameter ‘buf’ [-Wunused-parameter]
int32_t AmFFmpegByteIOAdapter::staticWrite(void* thiz, uint8_t* buf, int amt) {
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/utils/AmFFmpegByteIOAdapter.cpp:179:74: warning: unused parameter ‘amt’ [-Wunused-parameter]
int32_t AmFFmpegByteIOAdapter::staticWrite(void* thiz, uint8_t* buf, int amt) {
^
3 warnings generated.
[ 67% 31955/47622] target arm C++: libamffmpegadapter_32 <= vendor/amlogic/frameworks/av/AmFFmpegAdapter/utils/AmPTSPopulator.cpp
vendor/amlogic/frameworks/av/AmFFmpegAdapter/utils/AmPTSPopulator.cpp:44:42: warning: unused parameter ‘dts’ [-Wunused-parameter]
const int64_t pts, const int64_t dts, const bool isKeyFrame) {
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/utils/AmPTSPopulator.cpp:44:58: warning: unused parameter ‘isKeyFrame’ [-Wunused-parameter]
const int64_t pts, const int64_t dts, const bool isKeyFrame) {
^
2 warnings generated.
[ 67% 31955/47622] target arm C++: libamffmpegadapter_32 <= vendor/amlogic/frameworks/av/AmFFmpegAdapter/utils/AmFFmpegUtils.cpp
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target ‘ninja_wrapper’ failed
make: *** [ninja_wrapper] Error 1

make failed to build some targets (01:17:34 (hh:mm:ss))

After installing additional packages:
sudo apt-get install clang-3.5 llvm clang g++ subversion cmake

Now it keeps failing on this each time:
[ 67% 31955/47622] target SharedLib: libamffmpeg_32 (out/target/product/kvim/obj_arm/SHARED_LIBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so)
FAILED: /bin/bash out/target/product/kvim/obj_arm/SHARED_LIBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so.rsp
clang++: error: unable to execute command: Aborted
clang++: error: linker command failed due to signal (use -v to see invocation)
[ 67% 31955/47622] target arm C++: libamffmpegadapter_32 <= vendor/amlogic/frameworks/av/AmFFmpegAdapter/utils/AmFFmpegByteIOAdapter.cpp

Did you Establish a Build Environment for your host PC?

If you have already done it , you can try to extend the swap partitions.

sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

:slight_smile: Have a try! Thanks!

Didn’t help - still stuch on similar error:

[ 67% 31969/47622] target SharedLib: libamffmpeg_32 (out/…IBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so)
FAILED: /bin/bash out/target/product/kvim/obj_arm/SHARED_LIBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so.rsp
clang++: error: unable to execute command: Aborted
clang++: error: linker command failed due to signal (use -v to see invocation)
[ 67% 31969/47622] target arm C++: libamffmpegadapter_32 …ogic/frameworks/av/AmFFmpegAdapter/codec/AmAudioCodec.cpp
In file included from vendor/amlogic/frameworks/av/AmFFmpegAdapter/codec/AmAudioCodec.cpp:24:
In file included from vendor/amlogic/frameworks/av/AmFFmpegAdapter/codec/AmAudioCodec.h:24:
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:76:52: warning: unused parameter ‘codecMime’ [-Wunused-parameter]
virtual int32_t video_decode_init(const char * codecMime, VIDEO_INFO_T *video_info=NULL){return 0;} //= 0;
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:76:77: warning: unused parameter ‘video_info’ [-Wunused-parameter]
virtual int32_t video_decode_init(const char * codecMime, VIDEO_INFO_T *video_info=NULL){return 0;} //= 0;
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:77:63: warning: unused parameter ‘data’ [-Wunused-parameter]
virtual int32_t video_decode_frame(VIDEO_FRAME_WRAPPER_T *data, int *got_frame, PACKET_WRAPPER_T * pkt) {return 0;}//= 0;
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:77:74: warning: unused parameter ‘got_frame’ [-Wunused-parameter]
virtual int32_t video_decode_frame(VIDEO_FRAME_WRAPPER_T *data, int *got_frame, PACKET_WRAPPER_T * pkt) {return 0;}//= 0;
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:77:104: warning: unused parameter ‘pkt’ [-Wunused-parameter]
virtual int32_t video_decode_frame(VIDEO_FRAME_WRAPPER_T *data, int *got_frame, PACKET_WRAPPER_T * pkt) {return 0;}//= 0;
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:83:56: warning: unused parameter ‘width’ [-Wunused-parameter]
virtual int32_t video_decode_get_display(int32_t * width, int32_t * height) {return 0;}//= 0;
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:83:73: warning: unused parameter ‘height’ [-Wunused-parameter]
virtual int32_t video_decode_get_display(int32_t * width, int32_t * height) {return 0;}//= 0;
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:88:52: warning: unused parameter ‘codeMime’ [-Wunused-parameter]
virtual int32_t audio_decode_init(const char * codeMime, AUDIO_INFO_T *ainfo){return 0;}
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:88:76: warning: unused parameter ‘ainfo’ [-Wunused-parameter]
virtual int32_t audio_decode_init(const char * codeMime, AUDIO_INFO_T *ainfo){return 0;}
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:89:64: warning: unused parameter ‘data’ [-Wunused-parameter]
virtual int32_t audio_decode_frame(AUDIO_FRAME_WRAPPER_T * data, int * got_frame, PACKET_WRAPPER_T * avpkt){return 0;}
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:89:76: warning: unused parameter ‘got_frame’ [-Wunused-parameter]
virtual int32_t audio_decode_frame(AUDIO_FRAME_WRAPPER_T * data, int * got_frame, PACKET_WRAPPER_T * avpkt){return 0;}
^
vendor/amlogic/frameworks/av/AmFFmpegAdapter/include/AmFFmpegCodec.h:89:106: warning: unused parameter ‘avpkt’ [-Wunused-parameter]
virtual int32_t audio_decode_frame(AUDIO_FRAME_WRAPPER_T * data, int * got_frame, PACKET_WRAPPER_T * avpkt){return 0;}
^
12 warnings generated.
[ 67% 31969/47622] target arm C++: libamffmpegadapter_32 …rameworks/av/AmFFmpegAdapter/formatters/AVCCFormatter.cpp
ninja: build stopped: subcommand failed.
build/core/ninja.mk:148: recipe for target ‘ninja_wrapper’ failed
make: *** [ninja_wrapper] Error 1

make failed to build some targets (01:01:10 (hh:mm:ss))

I will try on different machine (probably on VirtualBox). This was failing on Linux Mint 18.1 (not virtual machine).

No luck :worried:

How you set up your building environment? Maybe my issues comes up from that. If I use Ubuntu 16, by default it ships with gcc 5.x. Maybe it is wrong for building Android? Somewhere I’ve read it needs gcc 4.9 or so…

Mainly I get clang++ errors and when I run clang++ -v I can see that it uses gcc 5.

So totally confused…

What is the environment you build Android Nougat?

Actually it fails in the same place regardless of gcc/g++ version - tried on fresh environment with gcc 4.8 and failed in the very same place:

[ 67% 31964/47622] target SharedLib: libamffmpeg_32 (out/targe…RED_LIBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so)
FAILED: /bin/bash out/target/product/kvim/obj_arm/SHARED_LIBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so.rsp
clang++: error: unable to execute command: Aborted
clang++: error: linker command failed due to signal (use -v to see invocation)

So maybe something’s missing in sources?

Might me something with this as error also mentions libamffmpeg: https://github.com/khadas/android_external_ffmpeg/commit/275dee1cfd4d40b121ef4c74629db38d7498e9df

One more thing I’ve tried was using ffmpeg from LineageOS and CyanogenMod, but it failed with build script error. Then I’ve tried using Nougat branch of following:

But again error here:

[quote][ 67% 31963/47622] target SharedLib: libamffmpeg_32 (out/target/product/kvim/obj_arm/SHARED_LIBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so)
FAILED: /bin/bash out/target/product/kvim/obj_arm/SHARED_LIBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so.rsp
clang++: error: unable to execute command: Aborted
clang++: error: linker command failed due to signal (use -v to see invocation)
[ 67% 31963/47622] target arm C++: libamffmpegadapter_32 <= vendor/amlogic/frameworks/av/AmFFmpegAdapter/utils/AmPTSPopulator.cpp[/quote]

Sorry, Marshmallow uses android_external_ffmpeg while Nougat uses android_vendor_amlogic_external_ffmpeg.

Maybe it’s actually this repository that triggers error: GitHub - khadas/android_vendor_amlogic_external_ffmpeg

@Gouwa @Terry please help :disappointed:

Please give me more informations about it

  1. what’s the system of your host PC ?
  2. Did you try to Establish a Build Environment ?
  3. Did you extend the swap partition ?
terry@Server:~/project/vim/nougat/vendor/amlogic/external/ffmpeg$ free -m
             total       used       free     shared    buffers     cached
Mem:         19955      13181       6773         15       6905       2179
-/+ buffers/cache:       4097      15857
Swap:        20351          0      20351

Tried to build on virtual PCs with Ubuntu 14 and Ubuntu 15 (on VirtualBox), then tried building on physical computers: one running Linux Mint 18 (= Ubuntu 16) with 16 GB RAM, another Linux Mint 17 (= Ubuntu 14) with 8 GB RAM - they all fail on the same error at 67%:

[quote][ 67% 31963/47622] target SharedLib: libamffmpeg_32 (out/target/product/kvim/obj_arm/SHARED_LIBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so)
FAILED: /bin/bash out/target/product/kvim/obj_arm/SHARED_LIBRARIES/libamffmpeg_intermediates/LINKED/libamffmpeg.so.rsp
clang++: error: unable to execute command: Aborted
clang++: error: linker command failed due to signal (use -v to see invocation)[/quote]

Build environment is established according to instructions and it builds uboot successfully. On the same system I successcully build Lineage OS 14.1 for Odroid XU3/4 and Shamu, so I believe it is sufficient to build Android Nougat.

Did extend swap partition, results are the same.

Can you try to sync fresh repository (or at least android_vendor_amlogic_external_ffmpeg) to make sure you build exactly what is on repository and try to build it?

Maybe something missing on GitHub or incorrect version?

Hi,Gytis
The source code on github is correct. The user ‘Davemf’ build the Android Nougat successfully. I don’t build the source code with Linux Mint.I build it with Ubuntu14.04. Of course,I can’t give you more suggestions.I’am sorry for that.

@davemf, have you stumbled upon some of these errors while building Nougat? Which ubuntu version did you use?

[quote]clang++: error: unable to execute command: Aborted
clang++: error: linker command failed due to signal (use -v to see invocation)[/quote]

I managed to build Android Nougat successfully on Ubuntu 14 under VirtualBox, will post instructions how I’ve made it :relaxed:

However, when booted Android keeps triggering “system UI failed” error.

1 Like

Does it work with your 8 GB RAM to build Nougat? Thank you very much. @Terry

root@doelmann-HP-EliteDesk-800-G1-TWR:/home/doelmann/AOSP_7/vendor/amlogic/external/ffmpeg# free -m
total used free shared buffers cached
Mem: 7895 6052 1843 231 434 3503
-/+ buffers/cache: 2113 5781
Swap: 8102 291 7811

Does it work with this PC Environment to build Nougat?

Well it is still possible to build on that kind of old machines… At least I can build Pie image with 8 GB RAM, just add more swap at least to 16GB.
me@server:~$ LANG=C free
total used free shared buff/cache available
Mem: 8151216 469636 979744 10576 6701836 7366664
Swap: 16777212 315392 16461820

However a possibility to build android system will depend on your processor features - it requires SSE4 and POPCNT instruction to be supported. If there is no POPCNT instruction supported by processor - it will require some changes to the sources to build successfully.

1 Like