I am totally new to programming.
I am using windows 7 and eclipse.
I have searched all the place and i have tried all of the recommended solution and nothing works for me. Please let me know how to change them.
So please help me to understand what you are trying to say.
The cocos version i am using is 3.3 (cocos2d-x-3.3)
NDK is version r9D
Thank you.
I am not sure why CDT Build console is giving me these errors.
"
**** Build of configuration Release for project KIKILA ****
python C:/Users/SM/workspace/KIKILA/build_native.py -b release all
Android NDK: WARNING: APP_PLATFORM android-15 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Android NDK: WARNING: Ignoring unknown import directory: jni/../../cocos2d
Android NDK: WARNING: Ignoring unknown import directory: jni/../../cocos2d/external
Android NDK: WARNING: Ignoring unknown import directory: jni/../../cocos2d/cocos
Android NDK: C:\apps\adt-bundle-windows-x86_64-20140702\cocos\cocos2d-x-3.3\external/flatbuffers/Android.mk: Cannot find module with tag 'external/jansson' in import path
jni/Android.mk:41: *** Android NDK: Aborting. . Stop.
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Traceback (most recent call last):
File "C:/Users/SM/workspace/KIKILA/build_native.py", line 159, in <module>
Android NDK: The following directories were searched:
build(opts.ndk_build_paSM,opts.android_platform,opts.build_mode)
File "C:/Users/SM/workspace/KIKILA/build_native.py", line 146, in build
do_build(cocos_root, ndk_root, app_android_root,ndk_build_param,sdk_root,android_platform,build_mode)
File "C:/Users/SM/workspace/KIKILA/build_native.py", line 82, in do_build
raise Exception("Build dynamic library for project [ " + app_android_root + " ] fails!")
Exception: Build dynamic library for project [ C:\Users\SM\workspace\KIKILA ] fails!
Android NDK:
make.exe: Entering directory `C:/Users/SM/workspace/KIKILA'
make.exe: Leaving directory `C:/Users/SM/workspace/KIKILA'
The Selected NDK toolchain version was 4.8 !
**** Build Finished ****
The problem was due to the build_native.py script.
The build_native.py hasn't been maintained for ages and it has been deprecated. So you can't rely on it to build your Android project. But Cocos guys haven't make it clear to developers.
Try use cocos run command instead.
You could run the following command to build and run your project.
cd KIKILA
cocos run -p android
Before running the cocos command, you might need to configure it:
cd COCOS2DX_ROOT(your cocos2d-x folder)
python setup.py
Related
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.
Did a project on the cocos2d-x for ios. Now try to run it for android.Sobirayu using eclipse. Eliminated like all the mistakes and now he writes:
**** Build of configuration Default for project Cut2 ****
bash /Users/Banck/cocos2d-x-2.2-2.1/projects/Cut2/proj.android/build_native.sh
NDK_ROOT = /Users/Banck/Downloads/android-ndk-r9b
COCOS2DX_ROOT = /Users/Banck/cocos2d-x-2.2-2.1/projects/Cut2/proj.android/../../..
APP_ROOT = /Users/Banck/cocos2d-x-2.2-2.1/projects/Cut2/proj.android/..
APP_ANDROID_ROOT = /Users/Banck/cocos2d-x-2.2-2.1/projects/Cut2/proj.android
Using prebuilt externals
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Android NDK: WARNING:/Users/Banck/cocos2d-x-2.2-2.1/projects/Cut2/proj.android/../../../cocos2dx/Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries
make: Entering directory `/Users/Banck/cocos2d-x-2.2-2.1/projects/Cut2/proj.android'
[armeabi] Install : libcocos2dcpp.so => libs/armeabi/libcocos2dcpp.so
make: Leaving directory `/Users/Banck/cocos2d-x-2.2-2.1/projects/Cut2/proj.android'
**** Build Finished ****
And that takes a message you need to fix what is wrong.But what's wrong? It seems to be all right already ... Advice please
It seems ok, you just need to use this 'ant debug' command to generate an .apk package for you.
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.
I have the following in my ".bashrc"
export ANDROID_SDK=/cygdrive/c/adt-bundle-windows-x86_64/sdk
export ANDROID_NDK=/cygdrive/c/android-ndk-r8d
export PATH=$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ANDROID_NDK
When I build the project it fails with the error below.
Android NDK: No local settings... build all in release mode !
Android NDK: ERROR:/home/XXX/jni/Android.mk:gcc: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that //c:/android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/libgcc.a exists or that its path is correct
/cygdrive/c/android-ndk-r8d/build/core/prebuilt-library.mk:43: *** Android NDK: Aborting . Stop.
Using the shell I can see that
//c:/ android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/libgcc.a"
cannot be found, yet
/cygdrive/c/ android-ndk-r8d/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6/libgcc.a
can be found. So the question is why is the NDK expanding the drive/path like this? (you can see it does not always do this see the last line of the error)
Is there a fix?
I am getting some issues here while I am trying to compile my code with Cgywin.
$ /cygdrive/c/native_work/android-ndk-r8b/ndk-build
Android NDK: WARNING: Unsupported source file extensions in jni/Android.mk for module main
Android NDK: NotePaperDetector.hpp
Install : libmain.so => libs/armeabi-v7a/libmain.so
so how I can compile the .hpp file ?
Now as #mah you said I have removed it from my Android.mk but now its showing some different error -
$ /cygdrive/c/native_work/android-ndk-r8b/ndk-build
Compile++ thumb : main <= NotePaperDetector.cpp
In file included from jni/NotePaperDetector.hpp:4:0,
from jni/NotePaperDetector.cpp:1:
jni/NoteLocation.hpp:4:30: fatal error: opencv2/opencv.hpp: No such file or directory
compilation terminated.
/cygdrive/c/native_work/android-ndk-r8b/build/core/build-binary.mk:255: recipe for target `obj/local/armeabi-v7a/objs/main/NotePaperDetector.o' failed
make: *** [obj/local/armeabi-v7a/objs/main/NotePaperDetector.o] Error 1
With the latest NDK releases you don't need Cygwin at all.
By the way a GNU/Linux platform is always the best for Android developers.