I followed the directions from http://source.android.com/source/building.html. However once I get to "Emulate an Android Device" section, there is no "emulator".
During the build, I got Killed messages:
/bin/bash: line 1: 5372 Killed javac -J-Xmx512M -target 1.5 -Xmaxerrs >9999999 -encoding ascii -g -classpath out/host/linux-x86/framework/dx.jar:out
/host/linux->x86>/framework/dasm.jar:out/host/linux-x86/framework/cfassembler.jar:/usr/lib
/jvm/java-1.5.0>-sun/lib/tools.jar -extdirs "" -d out/host/common/obj/JAVA_LIBRARIES
/cts-dalvik-buildutil_intermediates/classes \#out/host/common/obj/JAVA_LIBRARIES/cts-dalvik-
buildutil_intermediates/java-source-list-uniq
make: * [out/host/common/obj/JAVA_LIBRARIES/cts-dalvik-buildutil_intermediates/javalib.jar] Killed
This is the first javac command that follows the C++ compilations.
I've retried it multiple times without success.
The problem resulted from paths not being properly exported.
I followed this link: http://blog.markloiseau.com/2012/07/envsetup-setpaths-and-the-emulator-avd-error/
and set ANDROID_PRODUCT_OUT=/out/target/product/generic/
and also emulator is located at out/host/linux-x86/bin/emulator
Related
I am currently compiling a custom recovery for an android phone. Sources are synced, device tree etc. all set up correctly. Now I am facing a rather banal-looking error during build. cp refuses to copy a directory, because -r is not specified in the build file.
I obviously tried to find the build file (rw_recovery/out/build_omni_daisy.ninja) and add the -r argument, but it seems to be regenerated at the beginning of every build process, as the process still fails and the previously changed line appears unchanged when opening the file after the attempted build.
These are the build steps:
. build/envsetup.sh
lunch omni_daisy-eng #config for the device
mka bootimage #device uses boot.img as recovery
This command leaves me with the following error:
[ 99% 6883/6884] Prebuilt (rw_recovery/out/target/product/daisy/kernel)
FAILED: rw_recovery/out/target/product/daisy/kernel
/bin/bash -c "(rm -f /home/luca/rw_recovery/out/target/product/daisy/kernel) && (cp rw_recovery/out/target/product/daisy/obj/KERNEL_OBJ/arch/arm64/boot/ rw_recovery/out/target/product/daisy/kernel )"
cp: -r not specified; omitting directory 'rw_recovery/out/target/product/daisy/obj/KERNEL_OBJ/arch/arm64/boot/'
ninja: build stopped: subcommand failed.
17:13:06 ninja failed with: exit status 1
I would love to hear any suggestions about how to force ninja to execute the command with -r. Alternatively, suggestions about where to find the file from which the above mentioned build file is recreated after executing mka command are much welcomed as well.
I am trying to achieve something similar to this
https://github.com/volatilityfoundation/volatility/wiki/Android#initialize-the-android-build-environment.
Below is the environment I am using:
Ubuntu 14.04, Android Studio 2.3, Android NDK r14, emulator -api22.
I am facing difficulties at step Cross Compile the Kernel.
I am targeting the goldfish kernel 3.10
following are the step I followed. Any help would be really appreciated.
method 1:
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=~/android-ndk/android-ndk-r14/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
The tutorial suggesting that we have to run the next command as
make goldfish_armv7_defconfig
but when I checked the directory "android-source/arch/arm/configs/" there is no such config file there. Some tutorials suggesting that we can just copy and paste the file from kernel 2.6, so I did the same thing, and after that add
CONFIG_MODULES=y
CONFIG_MODULES_UNLOAD=y
CONFIG_MODULES_FORCE_UNLOAD=y
But futher
$ make
results in error:
arch/arm/mm/mmu.c: In function 'build_mem_type_table':
arch/arm/mm/mmu.c:470:18: error: 'L_PTE_MT_VECTORS' undeclared (first use in this function)
vecs_pgprot |= L_PTE_MT_VECTORS;
^
arch/arm/mm/mmu.c:470:18: note: each undeclared identifier is reported only once for each function it appears in
arch/arm/mm/mmu.c: At top level:
arch/arm/mm/mmu.c:637:23: warning: 'early_pte_alloc_and_install' defined but not used [-Wunused-function]
static pte_t * __init early_pte_alloc_and_install(pmd_t *pmd,
^
make[1]: *** [arch/arm/mm/mmu.o] Error 1
make: *** [arch/arm/mm] Error
methos 2:
Everything is same as in method 1, I just changed single variable
export ARCH=arm64
And run
make ranchu_deconfig
But I got the same error.
method 3:
$ export ARCH=arm
$ export SUBARCH=arm
$ export CROSS_COMPILE=~/android-ndk/android-ndk-r14/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
$ make ranchu_defconfig
$ vim .config # added this to .config file
CONFIG_MODULES=y
CONFIG_MODULES_UNLOAD=y
CONFIG_MODULES_FORCE_UNLOAD=y
$ make
This command run successfully: zImage found.
But when I run the emulator using the below command
root#ubuntu:~/Android/Sdk/tools# ./emulator -avd Nexus5x22 -kernel ~/android-source2/android-source/arch/arm/boot/zImage -show-kernel –verbose
I am getting the error of "Linux kernel too old to run ram disk":
ram disk error
Google's Android Kernel is messed up. They forgot to define L_PTE_MT_VECTORS when they back ported this patch.
The solution is to just add it here.
Cocos2d-x 3.7.1 + ndk r10e project on Mac trying to debug in Eclipse. Days pass and the errors keep coming...
I can build and run using cocos compile and cocos run with -p android -m debug --ndk-mode NDK_DEBUG=1 from the terminal in proj.android.
My app runs Ok (eventually) on my x86 emulator no problem.
Typing 'ndk-gdb' in the terminal from ./proj.android and I get the error
ERROR: Could not find gdb.setup under ./libs/
BUT the file gdb.setup (and gdbserver & libcocos2dcpp.so) can be seen in ./proj.android/libs/x86 !?
My AndroidManifest.xml includes android:debuggable="true"
My jni/Application.mk includes APP_ABI := x86 (only)
If anyone can tell me how I can diagnose or fix this problem then I guess I owe them a beer (in Yorkshire btw)
UPDATE: I have tried running up GDB using the --verbose flag. The output shows
Using gdb setup init: ./libs/armeabi/gdb.setup
Using app out directory: ./obj/local/armeabi
Guess I need to change to settings/init file somewhere??
I ran into the same problem. It seems something changed in recent version of Android Build tools.
The trick is:
ERROR: Could not find gdb.setup under ./libs/
It expects gdb.setup is in the directory libs but NOT libs/armeabi
so the simple workground is to copy gdb.setup and gdbserver from "libs/cpu" to "libs" and it works like a magic!
This is a bug caused by adb from android sdk.Issue 191085: ndk-gdb issue - Could not find gdb.setup under ./libs/ (even though it's there)
Currently previewl channel's adb whose version is 1.0.35 still has the same problem.
Without revert adb to 1.0.31.A simple workaround would be modify ndk-gdb a little: change the line if [ $? = 0 ]; then which is below adb_var_shell BCFILES run-as $PACKAGE_NAME /system/bin/sh -c "ls lib/*.bc" to if [ $? = 1 ]; then
I create two standalone ndk compiler arm and x86, and set environment variable of windows, let's say CUSTOM_NDK. When I put arm path to CUSTOM_NDK, and under cygwin command line to compile such as arm-linux-androideabi-gcc -c xxx.cpp, it's working fine. But when I put x86 path to CUSTOM_NDK, close cygwin and reopen it to ensure the env variable is loaded, every time I launch i686-linux-android-gcc -c xxx.cpp, it gives me the following error:
i686-linux-android-gcc.exe: error: CreateProcess: No such file or directory
I use i686-linux-android-gcc --print-search-dirs, it gives me the following which seems correct to me
$ i686-linux-android-gcc -print-search-dirs
install: c:\dev\custom-android-toolchian_x86\bin\../lib/gcc/i686-linux-android/4.6/
programs: =c:/dev/custom-android-toolchian_x86/bin/../libexec/gcc/i686-linux-android/4.6/;c:/dev/custom-android-toolchian_x86/bin/../libexec/gcc/;c:/dev/custom-android-toolchian_x86/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/i686-linux-android/4.6/;c:/dev/custom-android-toolchian_x86/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/
libraries: =c:/dev/custom-android-toolchian_x86/bin/../lib/gcc/i686-linux-android/4.6/;c:/dev/custom-android-toolchian_x86/bin/../lib/gcc/;c:/dev/custom-android-toolchian_x86/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/lib/i686-linux-android/4.6/;c:/dev/custom-android-toolchian_x86/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/lib/;c:/dev/custom-android-toolchian_x86/bin/../sysroot/lib/i686-linux-android/4.6/;c:/dev/custom-android-toolchian_x86/bin/../sysroot/lib/;c:/dev/custom-android-toolchian_x86/bin/../sysroot/usr/lib/i686-linux-android/4.6/;c:/dev/custom-android-toolchian_x86/bin/../sysroot/usr/lib/
Any help is much appreciated!
Thanks
I'm trying to compile vlc using the following instructions http://wiki.videolan.org/AndroidCompile.
i get the vlc source using git but when i'm doing the next command:
cd extras/contrib
./bootstrap -t arm-eabi -d android
i'm getting this error:
[contrib] No install dir specified, using '/android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi'
[contrib] *****************************************************************
[contrib] * If you need contribs with all debug information, run this *
[contrib] * line and compile the libraries on your own. *
[contrib] * CONTRIBS_RELEASE=no ./bootstrap *
[contrib] *****************************************************************
[contrib] Using 1 processor(s)
when i make the next step that is 'make' i got the following failure;
make -C build-src tools
make[1]: Nothing to be done for `tools'.
make -C build-src
(cd zlib; CC="arm-linux-androideabi-gcc --sysroot=/android-ndk-r5b//platforms/android-9/arch-arm" CXX="arm-linux-androideabi-g++ --sysroot=/android-ndk-r5b//platforms/android-9/arch-arm" LD="arm-linux-androideabi-ld" RANLIB="arm-linux-androideabi-ranlib" AR="arm-linux-androideabi-ar" STRIP="arm-linux-androideabi-strip" ./configure --prefix=/android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi --static && make install)
Building static library libz.a version 1.2.5 with arm-linux-androideabi-gcc --sysroot=/android-ndk-r5b//platforms/android-9/arch-arm.
Checking for off64_t... No.
Checking for fseeko... No.
Checking for unistd.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf().
Checking for snprintf() in stdio.h... No.
WARNING: snprintf() not found, falling back to sprintf(). zlib
can build but will be open to possible buffer-overflow security
vulnerabilities.
Checking for return value of sprintf()... No.
WARNING: apparently sprintf() does not return a value. zlib
can build but will be open to possible string-format security
vulnerabilities.
arm-linux-androideabi-gcc --sysroot=/android-ndk-r5b//platforms/android-9/arch-arm -I/android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi/include -DNDEBUG -D__STDC_VERSION__=199901L -I/android-ndk-r5b//sources/cxx-stl/gnu-libstdc++/include -I/android-ndk-r5b//sources/cxx-stl/gnu-libstdc++/libs/armeabi/include -isystem /android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi/include -I/android-ndk-r5b//platforms/android-9/arch-arm/usr/include -DNO_FSEEKO -DNO_snprintf -DHAS_sprintf_void -I/android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi/include -DNDEBUG -D__STDC_VERSION__=199901L -I/android-ndk-r5b//sources/cxx-stl/gnu-libstdc++/include -I/android-ndk-r5b//sources/cxx-stl/gnu-libstdc++/libs/armeabi/include -isystem /android-sdk-mac_x86/vlc-android/extras/contrib/hosts/arm-eabi/include -I/android-ndk-r5b//platforms/android-9/arch-arm/usr/include -c -o adler32.o adler32.c
make[2]: arm-linux-androideabi-gcc: No such file or directory
make[2]: *** [adler32.o] Error 1
make[1]: *** [.zlib] Error 2
make: *** [using-src] Error 2
anyone can help? i'm using mac OS X 10.6.6
tnx
Given prior Linux CLI experience, the best I can tell you is that it doesn't look like your tool-chain is fully initialized and needs some setup. Below is a link that documents initialization for a MAC build environment:
http://source.android.com/source/initializing.html
You probably should have set your NDK installation properly.
Download the latest Android NDK.
Unzip and move the extracted “android-ndk-r6″ directory to “/Applications”, so you end up with “/Applications/android-ndk-r6″.
Edit “~/.profile” to add the following:
export ANDROID_NDK=/Applications/android-ndk-r5b
export PATH=$PATH:$ANDROID_NDK:$ANDROID_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin
The PATH was the key to solve this kind of problem to me. Because it makes possible to find and use "arm-linux-androideabi-gcc".
Refer to this web site.
http://www.doitscared.com/632/eclipse-indigo-for-android-development-on-mac-os-x-snow-leopard/