Can't compile CyanogenMod 13 - android

I'm trying to compile CyanogenMod from scratch with the help of this guide. I've done most of the steps without any errors, but at the brunch angler step, I keep getting this error:
Building with Jack: /home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/android-support-v13-ics-mr1_intermediates/classes.jack
host Executable: llvm-rs-cc (/home/hexafluoride/android/system/out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/llvm-rs-cc)
Building with Jack: /home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/com.android.gallery3d.common2_intermediates/classes.jack
target Symbolic: libssl (/home/hexafluoride/android/system/out/target/product/angler/symbols/system/lib64/libssl.so)
target StaticLib: libLLVMAArch64CodeGen (/home/hexafluoride/android/system/out/target/product/angler/obj/STATIC_LIBRARIES/libLLVMAArch64CodeGen_intermediates/libLLVMAArch64CodeGen.a)
Launching background server java -Dfile.encoding=UTF-8 -Xms2560m -XX:+TieredCompilation -jar /home/hexafluoride/android/system/out/host/linux-x86/framework/jack-launcher.jar -cp /home/hexafluoride/android/system/out/host/linux-x86/framework/jack.jar com.android.jack.server.JackSimpleServer
target StaticLib: libLLVMAArch64Info (/home/hexafluoride/android/system/out/target/product/angler/obj/STATIC_LIBRARIES/libLLVMAArch64Info_intermediates/libLLVMAArch64Info.a)
Launching background server java -Dfile.encoding=UTF-8 -Xms2560m -XX:+TieredCompilation -jar /home/hexafluoride/android/system/out/host/linux-x86/framework/jack-launcher.jar -cp /home/hexafluoride/android/system/out/host/linux-x86/framework/jack.jar com.android.jack.server.JackSimpleServer
target StaticLib: libLLVMAArch64Desc (/home/hexafluoride/android/system/out/target/product/angler/obj/STATIC_LIBRARIES/libLLVMAArch64Desc_intermediates/libLLVMAArch64Desc.a)
target StaticLib: libLLVMAArch64AsmParser (/home/hexafluoride/android/system/out/target/product/angler/obj/STATIC_LIBRARIES/libLLVMAArch64AsmParser_intermediates/libLLVMAArch64AsmParser.a)
target StaticLib: libLLVMAArch64AsmPrinter (/home/hexafluoride/android/system/out/target/product/angler/obj/STATIC_LIBRARIES/libLLVMAArch64AsmPrinter_intermediates/libLLVMAArch64AsmPrinter.a)
ERROR: /home/hexafluoride/android/system/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/exif/ExifData.java:1: The type java.lang.Object cannot be found in source files, imported jack libs or the classpath
ERROR: /home/hexafluoride/android/system/packages/apps/Gallery2/gallerycommon/src/com/android/gallery3d/exif/ExifData.java:19: The import android cannot be resolved
* lots of errors saying that basic types can't be resolved after this *
And then make fails. I've tried doing make showcommands, and this is the output:
if [ -s /home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/android-support-v4-jellybean_intermediates/jack-rsc/java-source-list-uniq ] ; then export tmpEcjArg="#/home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/android-support-v4-jellybean_intermediates/jack-rsc/java-source-list-uniq"; else export tmpEcjArg=""; fi; JACK_VM_COMMAND="java -Dfile.encoding=UTF-8 -Xms2560m -XX:+TieredCompilation -jar /home/hexafluoride/android/system/out/host/linux-x86/framework/jack-launcher.jar " JACK_JAR="/home/hexafluoride/android/system/out/host/linux-x86/framework/jack.jar" /home/hexafluoride/android/system/out/host/linux-x86/bin/jack #build/core/jack-default.args --verbose error -g --classpath /home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/sdk_v16_intermediates/classes.jack:/home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/sdk_v16_intermediates/classes.jack:/home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/android-support-v4-ics-mr1_intermediates/classes.jack --import /home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/android-support-v4-ics-mr1_intermediates/classes.jack -D jack.import.resource.policy=keep-first -D jack.import.type.policy=keep-first -D jack.java.source.version=1.7 --output-jack /home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/android-support-v4-jellybean_intermediates/classes.jack $tmpEcjArg || ( rm -f /home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/android-support-v4-jellybean_intermediates/classes.jack ; exit 41 )
ERROR: /home/hexafluoride/android/system/frameworks/support/v4/jellybean/android/support/v4/app/NavUtilsJB.java:0: The type android.app.Notification cannot be found in source files, imported jack libs or the classpath
build/core/java.mk:636: recipe for target '/home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/android-support-v4-jellybean_intermediates/classes.jack' failed
make: *** [/home/hexafluoride/android/system/out/target/common/obj/JAVA_LIBRARIES/android-support-v4-jellybean_intermediates/classes.jack] Error 41
What am I doing wrong? I'm on Ubuntu Server 16.04.

Alright, the problem probably was because I abruptly interrupted the build process because of a hang, and then tried to continue building from there.
I did a make clobber && brunch angler and it built successfully.

Related

Failed to build sample SDK add-on on Android 13 AOSP

I'm trying to build my own SDK add-on from scratch, and attempt to comply with the sample in device/sample. Complying to the instructions in README.txt, I got following failure while building:
[100% 1/1] analyzing Android.bp files and generating ninja file at out/soong/build.ninja
FAILED: out/soong/build.ninja
cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i "$BUILDER" --top "$TOP" --soong_o
ut "out/soong" --out "out" -o out/soong/build.ninja --globListDir build --globFile out/soong/globs-build.ninja -t -l out/.module_paths/Android.bp.list --available_env out/s
oong/soong.environment.available --used_env out/soong/soong.environment.used.build Android.bp
error: prebuilts/module_sdk/conscrypt/current/Android.bp:20:1: dependency "art-bootclasspath-fragment" of "conscrypt-module-sdk_com.android.conscrypt-bootclasspath-fragment#current
" missing variant:
apex:com.android.art
available variants:
os:android,arch:common
error: prebuilts/module_sdk/conscrypt/current/Android.bp:20:1: dependency "prebuilt_art-bootclasspath-fragment" of "conscrypt-module-sdk_com.android.conscrypt-bootclasspath-fragmen
t#current" missing variant:
apex:com.android.art
available variants:
os:android,arch:common
10:34:20 soong bootstrap failed with: exit status 1
Does anyone encounter the same issue? It would be appriciated if there's any workaround on this. Thanks.
Edit build/make/target/product/sdk_phone_x86_64.mk (or your device target file) and add following line at the end:
MODULE_BUILD_FROM_SOURCE := true
For me, that solved the error and the build now starts.
You can view my product repository (you can drop it in your source tree and use lunch aosp_sdk_phone_x86_64-eng) to have this change as well:
https://git.halogenos.org/halogenOS/android_product_halogenOS/

how to build android kernel goldfish 2.6.29 and run it on qemu?

I download source of android kernel with these commands:git clone https://android.googlesource.com/kernel/goldfish.git
git checkout -t origin/android-goldfish-2.6.29 -b goldfish
then, I make some conf with these commands in goldfish directory export CROSS_COMPILE=arm-eabi-
export ARCH=arm
export SUBARCH=arm
make goldfish_defconfig # configure the kernel
make -j2 # build it
but after that i got these text on terminal:
make: arm-eabi-gcc: Command not found
scripts/kconfig/conf -s arch/arm/Kconfig
make: arm-eabi-gcc: Command not found
CHK include/linux/version.h
SYMLINK include/asm -> include/asm-arm
...
make[1]: [kernel/bounds.s] Error 127
Makefile:974: recipe for target 'prepare0' failed
make: [prepare0] Error 2
and i tried to install arm-eabi-gcc with these commands:
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
sudo apt-get install gcc-arm-embedded
but nothing changes and got the make: arm-eabi-gcc: Command not found error again.
so do someone know how to fix this problem?
(i do this things on my ubuntu 17.04)
now that i use arm-none-eabi-gcc i got this error after i used make -j2 command:
scripts/kconfig/conf -s arch/arm/Kconfig
...
include/linux/compiler-gcc.h:86:30: fatal error: linux/compiler-gcc6.h: No such file or directory
#include gcc_header(__GNUC__)
...
HOSTLD scripts/mod/modpost
then i downgrade my gcc version to gcc version 4.7.4 (Ubuntu/Linaro 4.7.4-3ubuntu12)
but still get error include/linux/compiler-gcc.h:86:30: fatal error: linux/compiler-gcc6.h: No such file or directory
#include gcc_header(__GNUC__) ! can someone help?
The compiler binary in the gcc-arm-ebedded package is called arm-none-eabi-gcc, so you should set CROSS_COMPILE=arm-none-eabi-.

I try to build android source, make clobber got some errors about "depends on disabled module"

I'm a newbie at aosp. I just following the guild on https://source.android.com/source/building.html in "preparing to build" section.
After I execute repo sync successfully, I run make clobber and got some errors:
ninja: no work to do.
[1/2] glob external/*/Android.bp
[1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -b out/soong -d out/soong/build.ninja.d -o out/soong/build.ninja Android.bp
error: external/llvm/tools/gold/Android.bp:20:1: module "LLVMgold" variant "linux_x86_64_shared": depends on disabled module "libLLVM"
error: development/vndk/tools/vtable-dumper/Android.bp:17:1: module "vndk-vtable-dumper" variant "linux_x86_64": depends on disabled module "libLLVM"
error: external/llvm/tools/llvm-ar/Android.bp:5:1: module "llvm-ar" variant "linux_x86_64": depends on disabled module "libLLVM"
error: external/spirv-llvm/lib/SPIRV/Android.bp:22:1: module "libSPIRV" variant "linux_x86_64_shared": depends on disabled module "libLLVM"
error: frameworks/compile/libbcc/tools/bcc_strip_attr/Android.bp:19:1: module "bcc_strip_attr" variant "linux_x86_64": depends on disabled module "libLLVM"
ninja: build stopped: subcommand failed.
23:55:27 soong bootstrap failed with: exit status 1
build/core/main.mk:24: recipe for target 'run_soong_ui' failed
make: *** [run_soong_ui] Error 1
I have no idea about this.It's looks like there are some disabled modules.How can I handle it? I just want to build aosp and import into Intellij Idea to read some java codes.
Try using Ubuntu 14.04 LTS. I had the same error when trying to compile using Ubuntu 16.04 LTS.
It seems export FORCE_BUILD_LLVM_COMPONENTS=true gets you past that...

ubuntu 15.10 64bit build Android source 5.0 version

How can I fix this problem?When I was building the Android source of 5.0 with
'make -j4', it was causing a problem.
This is the error log:
Install: out/host/linux-x86/bin/acp
Yacc: aidl <= frameworks/base/tools/aidl/aidl_language_y.y
prebuilts/misc/linux-x86/bison/bison -d -o out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp frameworks/base/tools/aidl/aidl_language_y.y
Lex: aidl <= frameworks/base/tools/aidl/aidl_language_l.l
logtags: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/content/EventLogTags.java <= frameworks/base/core/java/android/content/EventLogTags.logtags
prebuilts/misc/linux-x86/bison/bison: m4 子进程失败
build/core/binary.mk:539: recipe for target 'out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp' failed
make: *** [out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_y.cpp] Error 1
make: *** 正在等待未完成的任务....
frameworks/base/tools/aidl/aidl_language_l.l:55: warning, 无法匹配规则
flex-2.5.39: fatal internal error, exec of /usr/bin/m4 failed
build/core/binary.mk:576: recipe for target 'out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp' failed
make: *** [out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Error 1
make: *** Deleting file 'out/host/linux-x86/obj32/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp'
logtags: out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/core/java/android/speech/tts/EventLogTags.java <= frameworks/base/core/java/android/speech/tts/EventLogTags.logtags
In my case, I get similar error when build Marshmallow 6.0.1_r1 in Ubuntu 18.04.
If you get similar errors like this:
build/core/binary.mk:646: recipe for target 'out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp' failed
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl_language_l.cpp] Aborted (core dumped)
Look at the line carefully, it's a core dumped, so I use coredumpctl list, navigate to the end of list with G, then figure out the core dump executed path (right column) is prebuilts/misc/linux-x86/flex/flex-2.5.39
And the PREBUILT file shows:
xb#dnxb:~/my_android_src/prebuilts/misc/linux-x86/flex$ cat PREBUILT
The objects in this prebuilt directory can be rebuilt
using the source archive hosted at
http://sourceforge.net/projects/flex/files/
Commands:
./configure
make CFLAGS="-static" LDFLAGS="-static"
# (Disregard the errors at the end of the build)
rm flex
make CFLAGS="-static" LDFLAGS="-static" flex
# Copy the linker command line, replace it with static libm.a
gcc -static -static -o flex ccl.o dfa.o ecs.o scanflags.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o /usr/lib/x86_64-linux-gnu/libm.a
xb#dnxb:~/my_android_src/prebuilts/misc/linux-x86/flex$
That's it, the first 2 lines said that you probably need to rebuild yourself if something went wrong since this flex-2.5.39 binary is prebuilt in another platform.
So simply untar the flex-2.5.39.tar.gz of this directory, go to the extracted flex-2.5.39 directory, then follows the PREBUILT instruction above.
In short, you need to do the following steps:
cd <ANDROID_TREE_DIR>/prebuilts/misc/linux-x86/flex
tar -zxvf flex-2.5.39.tar.gz
cd flex-2.5.39
make CFLAGS="-static" LDFLAGS="-static"
rm flex
make CFLAGS="-static" LDFLAGS="-static" flex
/bin/bash ./libtool --tag=CC --mode=link gcc -static -static -o flex ccl.o dfa.o ecs.o scanflags.o gen.o main.o misc.o nfa.o parse.o scan.o skel.o sym.o tblcmp.o yylex.o options.o scanopt.o buf.o tables.o tables_shared.o filter.o regex.o lib/libcompat.la /usr/lib/x86_64-linux-gnu/libm.a
cd ..
cp flex-2.5.39/flex .
mv flex flex-2.5.39
ls -la
flex-2.5.39 #### <<- YOUR new generated file
flex-2.5.39.tar.gz
MODULE_LICENSE_BSD_LIKE
NOTICE
PREBUILT
Now try to do make <module> -j4 again, no longer abort on such error.
p/s: Alternative way will be LANG=C make pm -j4 if you see something like LC_* error message.
p/s2: I also need symlink ld as below to fixed 'out/host/linux-x86/obj/lib/libart.so' failed and error: unsupported reloc 42:
xb#dnxb:~/my_android_src$ cp prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld ../ld_bk #backup android source's ld first
xb#dnxb:~/my_android_src$ rm prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld #remove android source's ld
xb#dnxb:~/my_android_src$ ln -s /usr/bin/ld.gold prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8//x86_64-linux/bin/ld #create symlink for android source's ld to system's ld.gold
Check carefully you have all the required packages installed https://source.android.com/source/initializing.html

android ndk-build error on ubuntu 12.10 32 bit

i have downloaded the latest android ndk r8b on my ubuntu 12.10 beta 2 .
i have included the ndk directory in the PATH variable (when i write ndk-b in terminal and hit tab it auto-completes it) .
but when i try :
cd android-ndk/samples/san-angeles/jni
ndk-build
i get this error:
make: /home/mixpro/Android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Command not found
make: /home/mixpro/Android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Command not found
Compile thumb : sanangeles <= importgl.c
make: /home/mixpro/Android/android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc: Command not found
make: *** [/home/mixpro/Android/android-ndk/samples/san-angeles/obj/local/armeabi/objs/sanangeles/importgl.o] Error 127
when checking the /android-ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin directory using ls i get:
arm-linux-androideabi-addr2line arm-linux-androideabi-g++
arm-linux-androideabi-gdbtui arm-linux-androideabi-size
arm-linux-androideabi-c++filt arm-linux-androideabi-gcc-4.6.x-google
arm-linux-androideabi-gprof arm-linux-androideabi-strings
arm-linux-androideabi-cpp arm-linux-androideabi-gcov
arm-linux-androideabi-readelf arm-linux-androideabi-elfedit
arm-linux-androideabi-gdb arm-linux-androideabi-run
meaning there is no arm-linux-androideabi-gcc in the directory
I am afraid that somehow you got arm-linux-androideabi-addr2line arm-linux-androideabi-gcc deleted. On linux, it is just a symlink to arm-linux-androideabi-gcc-4.6.x-google, so it's very easy to restore it. But maybe, to be on the safe side, it's worthwhile to reinstall NDK.
you should create symbolic link like this : ln -s /usr/bin/arm-linux-gnueabi-gcc-4.7 "/home/sofien/Bureau/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc"

Categories

Resources