Make error while trying to build NDK app - android

I'm new to Android programming and NDK, so i've followed this tutorial:
http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/ to
install and config cygwin and NDK. The problem appears when I try to execute
ndk-build command. It displays the following error message:
$ $NDK/ndk-build
Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 3in ./AndroidManifest.xml
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
install: nie można wykonać stat na `/cygdrive/d/Programowanie/Tools/ADT/NDK/prebuilt/android-arm/gdbserver/gdbserver': No such file or directory
/cygdrive/d/Programowanie/Tools/ADT/NDK/build/core/setup-toolchain.mk:155: polecenia dla obiektu 'libs/armeabi/gdbserver' nie powiodły się
make: *** [libs/armeabi/gdbserver] Błąd 1
Error messages are written in polish so here's my translation, however I'm not sure whether
it's fully correct:
$ $NDK/ndk-build
Android NDK: WARNING: APP_PLATFORM android-18 is larger than android:minSdkVersion 3in ./AndroidManifest.xml
Gdbserver : [arm-linux-androideabi-4.6] libs/armeabi/gdbserver
install: Cannot execute stat on `/cygdrive/d/Programowanie/Tools/ADT/NDK/prebuilt/android-arm/gdbserver/gdbserver': No such file or directory
/cygdrive/d/Programowanie/Tools/ADT/NDK/build/core/setup-toolchain.mk:155: commands for object 'libs/armeabi/gdbserver' didn't succeed.
make: *** [libs/armeabi/gdbserver] Error 1
I honestly have no idea what could have caused such an error, so I'm counting that
You can help me anyhow.
Thanks :-)

Modern versions of NDK do not need cygwin. Try to run you build from normal cmd prompt. To be on the safe side, remove cygwin\bin from PATH.

I have fixed my issue with NDK by downloading it again and reinstalling.
It seems like I haven't downloaded entire NDK package, and that it caused
the problem. Sorry for trouble, I should have checked whether reinstall
could help in this case on the beginning, but this idea must have slept
my mind.
Thanks for letting me know that I don't need cygwin for NDK anymore :-)
Best regards, Buyuk.

Related

Building AOSP master branch fails in Mac OSX

I am trying to build the master branch of AOSP, but it fails with following error:
host C++: validatekeymaps <= frameworks/base/tools/validatekeymaps/Main.cpp
In file included from frameworks/base/tools/validatekeymaps/Main.cpp:17:
In file included from frameworks/native/include/input/KeyCharacterMap.h:26:
In file included from frameworks/native/include/input/Input.h:25:
system/core/include/utils/Vector.h:20:10: fatal error: 'new' file not found
#include <new>
^
1 error generated.
make: *** [out/host/darwin-x86/obj/EXECUTABLES/validatekeymaps_intermediates/Main.o] Error 1
Does anyone has any idea on this? Where the "new" file should present? How would I solve this? Any help would be greatly appreciated.
I believe is a clang error. clang does not need .h header extensions. I wouldn't bet my life on it but I will suggest updating your host clang to the newest or newer version. It is definitely a host problem. I've seen it before, but don't remember all, plus I'm on Ubuntu and don't build AOSP. I do see a recent change added -Werror now into system/core so try doing a Host clang update... even if you already have that file, an update may fix HOST include paths.
One more thought. Try: echo $(HOST_TOOLCHAIN_ROOT)
If you don't get a location you may have a clang which is too new... my reason/reference:
https://android.googlesource.com/platform/build/+/master/core/combo/HOST_darwin-x86_64.mk:
# gcc location for clang; to be updated when clang is updated
# HOST_TOOLCHAIN_ROOT is a Darwin-specific define
HOST_TOOLCHAIN_FOR_CLANG := $(HOST_TOOLCHAIN_ROOT)

Android NDK sample build error linux

Hello I am new to Android and I am trying to build the hello-jni sample that is included in the NDK but I get the error below, any idea how to fix it?
15:57:10 ** Build of configuration Default for project HelloJni **
/media/Project/adt-bundle-linux-x86-20131030/adt-bundle-linux-x86-20131030/android-ndk-r9c/ndk-build
all Android NDK: WARNING: APP_PLATFORM android-19 is larger than
android:minSdkVersion 3 in ./AndroidManifest.xml [armeabi-v7a]
Compile thumb : hello-jni <= hello-jni.c arm-linux-androideabi-gcc:
error trying to exec
'/media/Project/adt-bundle-linux-x86-20131030/adt-bundle-linux-x86-20131030/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/as':
execv: Exec format error make: *
[obj/local/armeabi-v7a/objs/hello-jni/hello-jni.o] Error 1
15:57:10 Build Finished (took 230ms)
This is what I am using:
Ubuntu 10.04.4
ADT bundle for linux (v22.3.0-887826)
NDK r9c
Thanks in advance
The WARNING is correct, and should be ignored.
Regarding the gcc error, you probably have a problem with installation of NDK. How did you unpack it? Check
ls -l /media/Project/adt-bundle-linux-x86-20131030/adt-bundle-linux-x86-20131030/android-ndk-r9c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/arm-linux-androideabi/bin/as
This should be a symbolic link to ../../bin/arm-linux-androideabi-as, and both should have executable permissions.

Android: ndk-build is returning nothing?

I'm trying to rebuild my Native android project, however all of a sudden, ndk-build decides it doesn't want to, and seems to be sulking on me.
Here's my output:
nathan#nathan-K52F:~/COMBAT/engine/android-build$ android update project -p . -t 1 -s
Updated project.properties
Updated local.properties
Updated file ./proguard-project.txt
nathan#nathan-K52F:~/COMBAT/engine/android-build$ cd jni && ndk-build
nathan#nathan-K52F:~/COMBAT/engine/android-build/jni$ ndk-build
nathan#nathan-K52F:~/COMBAT/engine/android-build/jni$ cd ../
nathan#nathan-K52F:~/COMBAT/engine/android-build$ ndk-build
nathan#nathan-K52F:~/COMBAT/engine/android-build$ //should be erroring here - yet nothing?
It however at least tries to build another native project:
nathan#nathan-K52F:~/GamePlay/samples/browser/android/jni$ ndk-build
/home/nathan/android-ndk-r8e/build/core/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 9 in /home/nathan/GamePlay/samples/browser/android/AndroidManifest.xml
Android NDK: ERROR:/home/nathan/GamePlay/samples/browser/android/jni/Android.mk:gameplay: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that /home/nathan/GamePlay/samples/browser/android/jni/../../../../gameplay/android/obj/local/armeabi/libgameplay.a exists or that its path is correct
/home/nathan/android-ndk-r8e/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop.
nathan#nathan-K52F:~/GamePlay/samples/browser/android/jni$
The error's are suppose to be there by the way.
I just haven't a clue why it isn't compiling the project I WANT it to compile - I don't think it likes me anymore :L
I'm running on the latest Ubuntu OS, with NDK r8 and JDK 1.7
I didn't add my the new files to my makefile to be compiled.

Error with building Android NDK Project

I wand build project in windows, I get same Errors:
bash C:\linux\android-ndk1\ndk-build V=1
cygwin warning:
MS-DOS style path detected: C:\dev\android\workspace4_android\FFWall
Preferred POSIX equivalent is: /cygdrive/c/dev/android/workspace4_android/FFWall
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Android NDK: ERROR:jni/Android.mk:bambuser-libavcore: LOCAL_SRC_FILES points to a missing file
/cygdrive/c/linux/android-ndk1/build/core/prebuilt-library.mk:43: *** Android NDK: Aborting . Stop.
Android NDK: Check that jni/ffmpeg-android/build/ffmpeg/armeabi/lib/libavcore.so exists or that its path is correct
Another way building:
C:\art\android-ndk\ndk-build V=1
Cannot run program "C:\art\android-ndk\ndk-build": Launching failed
Error: Program "C:/art/android-ndk/ndk-build" is not found in PATH
PATH=[C:\Art\android-ndk;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Program Files\PC Connectivity Solution\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\MATLAB\R2011a\runtime\win32;C:\Program Files\MATLAB\R2011a\bin;C:\Program Files\MATLAB\R2007b\bin;C:\Program Files\MATLAB\R2007b\bin\win3;C:\dev\android\android-sdk-windows\tools;C:\cygwin\bin;C:/art/android-ndk/;C:\linux\android-ndk-r7b;C:\dev\android\eclipse]
Why this happened?
From: http://developer.android.com/sdk/ndk/overview.html#reqs
Required development tools
For all development platforms, GNU Make 3.81 or later is required. Earlier versions of GNU Make might work but have not been tested.
A recent version of awk (either GNU Awk or Nawk) is also required.
For Windows, Cygwin 1.7 or higher is required. The NDK will not work with Cygwin 1.5 installations.
Meaning, that you will have to install Cygwin. After that you can call the ndk-build like:
$ProjectPath> /cygdrive/c/myNdkPath/ndk-build
Please also check the "Getting Started" part of:
http://developer.android.com/sdk/ndk/index.html

ndk-build error in cygwin

I am following the steps as in http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/comment-page-2/#comment-32553 to install ndk using cygwin and eclipse.
I installed all the required packages and software, including cygwin, gnuwin32, gcc, make, and android-ndk. Then I created a test android project, ndkfoo. Once I type /cygdrive/c/Android/android-ndk/ndk-build, I get the following error messages, see the bottom. I am guessing there is something wrong with my path setting, but I do not how to make the change. In the example, the first line from the console should looks like "Compile thumb : ndkfoo <= /cygdrive/c/Users/workspace/ndkfoo.c"
Does anyone have a clue where I should start? Thanks a lot.
Compile thumb : ndkfoo <= ndkfoo.c
arm-linux-androideabi-gcc.exe: C:/Users/workspace/ndkfoo/obj/local/armeabi/objs/ndkfoo/ndkfoo.o: No such file or directory
arm-linux-androideabi-gcc.exe: no input files
make: *** `[/cygdrive/c/Users/workspace/ndkfoo/obj/local/armeabi/objs/ndkfoo/ndkfoo.o] Error 1`
Looks like the problem is in your make file. Are you using Windows paths there by any chance?

Categories

Resources