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?
Related
I successfully created an image for Samsung Note 3 by downloading the source from Samsung and AOSP and running make as instructed in the README file. But now I want to modify a device driver, and see the result in the image. This means I really do not want to recreate an entire image; rather just the modified file, which is /drivers/char/examples directory. I have tried "m", "mm", and "mmm" but I get the following error:
sansari#ubuntu:~/WORKING_DIRECTORY$ m
m: command not found
sansari#ubuntu:~/WORKING_DIRECTORY$ mm
The program 'mm' is currently not installed. You can install it by typing:
sudo apt-get install multimail
I have also tried to run make from the example directory and I get:
sansari#ubuntu:~/WORKING_DIRECTORY/drivers/char/examples$ make
make --directory=src
make: *** src: No such file or directory. Stop.
make: *** [src] Error 2
Here is what I have in this directory as well as the make file:
sansari#ubuntu:~/WORKING_DIRECTORY/drivers/char/examples$ ls
backup examples.c hello1.c Makefile
sansari#ubuntu:~/WORKING_DIRECTORY/drivers/char/examples$ more Makefile
lib_src := src
lib_headers := headers
.PHONY: all $(lib_src) $(lib_headers)
$(lib_src) :
$(MAKE) --directory=$#
$(lib_*): $(MAKE) --directory=$#
obj-$(CONFIG_TOS) += examples.o
What should I do so that when I update the c source file, I can build an updated image to flash my phone and try to see the result?
I wonder if I remove the examples.ko, make will rebuild again. The question is would this work if I issue make just for the /examples directory?
Thanks,
Sean
There's a lot that is wrong here, so it is impossible to figure out what is supposed to happen. I'll just describe what's going on.
sansari#ubuntu:~/WORKING_DIRECTORY/drivers/char/examples$ make
make --directory=src
make: *** src: No such file or directory. Stop.
make: *** [src] Error 2
means that the Makefile is expecting a directory called src to exist under the place where you run make. That directory should have a file called Makefile in it which will give further instructions for how to compile examples.c and hello1.c.
Let's say the src directory is under ~/WORKING_DIRECTORY. In that case you would invoke make via make -f drivers/char/examples.
However I'm guessing that in that directory or one of the others, you should see the programs m or mm that I guess you were instructed to run. And I'm also guessing that this is what will issue that more unusual make command.
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)
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.
I'm having a hard time setting up PowerVR SDK for Android on Windows 8 64, assuming I met all requirements:
Android SDK (fresh Eclipse)
Android NDK
Cygwin (with make)
PowerVR Android SDK 3.0
I can perfectly make and run an Android NDK sample. However, the same process fails for building any PowerVR sample (from the SDK). Here's the output when I try to run the makefile:
$ ndk
Compile++ thumb : OGLES2Texturing <= OGLES2Texturing.cpp
arm-linux-androideabi-g++.exe: error: C:/cygwin///cygdrive/c/Users/stfn/workspaces/android/03_Texturing/jni/OGLES2Texturing.cpp: No such file or directory
arm-linux-androideabi-g++.exe: fatal error: no input files
compilation terminated.
/cygdrive/c/android-ndk-r8d/build/core/build-binary.mk:269: recipe for target `obj/local/armeabi/objs/OGLES2Texturing//cygdrive/c/Users/stfn/workspaces/android/03_Texturing/jni/OGLES2Texturing.o' failed
make: * [obj/local/armeabi/objs/OGLES2Texturing//cygdrive/c/Users/stfn/workspaces/android/03_Texturing/jni/OGLES2Texturing.o] Error 1
I suppose the error should be related to a wrong path given to the compiler. To me it looks like a mixture of standard Windows and Cygwin/Unix paths: * C:/cygwin///cygdrive/c/Users/stfn/...*
If been through so many makefiles now trying to resolve this issue but I just don't know where else to look. This is the first time I tried messing with the NDK. I'm afraid this could be my last.
Any help would be greatly appreciated
1.in the Android.mk file, for the PVRSDKDIR, set the path of your project folder in your workspace.
2.Copy the build, tools, and shell folders from the powervr sdk folder to your project folder
I'm starting to use the android ndk (r8c), and for that I have installed a fresh version of Ubuntu 12.10 (32bit)
Problem, whatever I try to build, I got freaky errors that drive me crazy...
~/workspace/Test$ ndk-build
Compile thumb : Test <= Test.c
SharedLibrary : libTest.so arm-linux-androideabi-g++: error:
./obj/local/armeabi/objs/Test/Test.o: No such file or directory make:
* [obj/local/armeabi/libTest.so] Error 1
So here, I try to run ndk-build on a simple hello world in jni. I can't understand the problem, as I thought the ndk-build command was suppose to create Test.o itself...
So I tried the same thing with ndk-r7 (we never know), and it is even uglier...
~/workspace/Test$ ~/Code/android-ndk-r7/ndk-build
Compile thumb :
Test <= Test.c Messages de l'assembleur: Erreur fatale: option -march=
invalide: « armv5te » make: * [obj/local/armeabi/objs/Test/Test.o]
Erreur 1
I can't find any answer that seems to help. (I've also tried to build hello-jni sample the same way, but the output was the same.
Please, someone save my hair... Hope I've been clear enough.
So I decided to reinstall my ubuntu, and it worked well this time.
I still have no idea why it didn't the first time, as I think I have done exactly the same manipulation (I went to Ubuntu 12.04 instead of 12.10 though).