I am unable to ndk-build - android

aison#jaison-virtual-machine:~/Downloads/pjproject-2.2.1/pjsip-apps/src/pjsua/android$ ndk-build -fexceptions
Android NDK: WARNING: APP_PLATFORM android-19 is larger than android:minSdkVersion 15 in ./AndroidManifest.xml
Android NDK: WARNING:jni/Android.mk:pjsua: non-system libraries in linker flags: -lpjsua-arm-unknown-linux-androideabi -lpjsip-ua-arm-unknown-linux-androideabi -lpjsip-simple-arm-unknown-linux-androideabi -lpjsip-arm-unknown-linux-androideabi -lpjmedia-codec-arm-unknown-linux-androideabi -lpjmedia-arm-unknown-linux-androideabi -lpjmedia-videodev-arm-unknown-linux-androideabi -lpjmedia-audiodev-arm-unknown-linux-androideabi -lpjmedia-arm-unknown-linux-androideabi -lpjnath-arm-unknown-linux-androideabi -lpjlib-util-arm-unknown-linux-androideabi -lsrtp-arm-unknown-linux-androideabi -lresample-arm-unknown-linux-androideabi -lgsmcodec-arm-unknown-linux-androideabi -lspeex-arm-unknown-linux-androideabi -lilbccodec-arm-unknown-linux-androideabi -lg7221codec-arm-unknown-linux-androideabi -lpj-arm-unknown-linux-androideabi -lgnustl_static -lgcc
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the
Android NDK: current module
make: exceptions: No such file or directory
make: *** No rule to make target `exceptions'. Stop.
I am getting that error while doing ndk-build in Ubuntu.
Please help me.
Thanks in advance.

Use ndk-build APP_CPPFLAGS=-fexceptions, or better set this flag in file Application.mk.

Related

android ndk project having error when loading the library

i am very new to the android ndk and opencv
but i have already run some samples/tutorials of opencv projects in Eclipse
therefore the opencv library should not be a problem
Here i want to run this camera project from github, i think it should work
After I downloaded it and import it into the Eclipse,
I encountered a problem :
When I run it it stops and finishes because the library cannot be loaded in the CameraActivity.
-> System.loadLibrary("PanoHDR");
I have tried to search the web for solutions but they either didn't work or I didn't understand them.
Do I need to do something like "ndk-build" at somewhere to make it work?
Could someone please help me? I cannot find any solution.
here is the default android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# Tegra optimized OpenCV.mk
include /Users/milmil/Documents/NVPACK/OpenCV-2.4.5-Tegra-sdk-r2/sdk/native/jni/OpenCV-tegra3.mk
# Linker
LOCAL_LDLIBS += -llog
# Our module sources
LOCAL_MODULE := PanoHDR
LOCAL_SRC_FILES := PanoHDR.cpp Panorama.cpp HDR.cpp NativeLogging.cpp
include $(BUILD_SHARED_LIBRARY)
when i try to use ndk-build in cmd in the main dir of the project
it fails
jni/Android.mk:6: /sdk/native/jni/OpenCV.mk: No such file or directory
make: *** No rule to make target `/sdk/native/jni/OpenCV-tegra3'. Stop.
and it should be caused by this line in the Andriod.mk
include /Users/milmil/Documents/NVPACK/OpenCV-2.4.5-Tegra-sdk-r2/sdk/native/jni/OpenCV-tegra3.mk
I try to use the path of my opencv sdk
include /Android/OpenCV-3.1.0-android-sdk/OpenCV-android-sdk/sdk/native/jni/OpenCV.mk
and it returns this in the cmd
Android NDK: WARNING:jni/Android.mk:PanoHDR: non-system libraries in linker flag
s: -lopencv_java3
Android NDK: This is likely to result in incorrect builds. Try using LOCAL_S
TATIC_LIBRARIES
Android NDK: or LOCAL_SHARED_LIBRARIES instead to list the library dependenc
ies of the
Android NDK: current module
[armeabi-v7a] "Compile++ thumb": "PanoHDR <= PanoHDR.cpp"
The system cannot find the path specified.
make: *** [obj/local/armeabi-v7a/objs/PanoHDR/PanoHDR.o] Error 1
Thank you
=========================================================================
WARNING:jni/Android.mk:PanoHDR: non-system libraries in linker flag
s: -lopencv_java3
the above problem is solved by adding "OPENCV_LIB_TYPE=STATIC" in the android.mk, but still has this error "
[armeabi-v7a] "Compile++ thumb": "PanoHDR <= PanoHDR.cpp"
The system cannot find the path specified.
make: *** [obj/local/armeabi-v7a/objs/PanoHDR/PanoHDR.o] Error 1"

Get ndk-gdb to work: Your APP_BUILD_SCRIPT points to an unknown file: Android.mk

There are several questions about this, and I've tried a couple of the solutions, but I'm still getting the above error.
My Project root is
/Users/me/main/src/task/task2/apps/MyApp
My jni folder is
/Users/me/main/src/task/task2/modules/jni
Android.mk is here
/Users/me/main/src/task/task2/modules/jni/Android.mk
Application.mk is here
/Users/me/main/src/task/task2/modules/jni/Application.mk
Here's where my ndk log ends:
Android NDK: Found project path: /Users/me/main/src/task/task2/modules
Android NDK: Ouput path for intermediate files: /Users/me/main/src/task/task2/modules/obj
Android NDK: Ouput path for generated library files: /Users/me/main/src/task/task2/modules/libs
Android NDK: Parsing /Users/me/main/src/task/task2/modules/jni/Application.mk
Android NDK: APP_PIE is
Android NDK: Enabling -fPIE
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: Android.mk
/Users/me/android/android-ndk-r10d/build/core/add-application.mk:199: *** Android NDK: Aborting... . Stop.
I haven't defined APP_BUILD_SCRIPT in my Application.mk, but I have defined NDK_PROJECT_ROOT environment variable in my .bash_profile to point to the modules directory (i.e: parent of jni directory).
Any ideas?

Can't get LAME to compile in JNI Android

I have been following this tutorial http://developer.samsung.com/android/technical-docs/Porting-and-using-LAME-MP3-on-Android-with-JNI, however I dont seem to get it to compile when it comes to Compilation with NDK section. The following is the error that I get
Android NDK: WARNING: APP_PLATFORM android-17 is larger than android:minSdkVersion 7 in ./AndroidManifest.xml
[armeabi] Compile thumb : mp3lame <= bitstream.c
jni/./libmp3lame/bitstream.c:33:18: fatal error: lame.h: No such file or directory
compilation terminated.
make.exe: * [obj/local/armeabi/objs/mp3lame/./libmp3lame/bitstream.o] Error 1
I have added
LOCAL_C_INCLUDES += jni/include
to Android.mk, so it can find the ".h" needed.

NDK_TOOLCHAIN is defined to the unsupported value

I'm woking on running an irrlicht android sample project in android emulator using android-ndk, When I have tried building that sample , the following error occurred:
/Android/android-ndk-r9/ndk-build V=1 NDK_TOOLCHAIN=arm-2010q1
/Android/android-ndk-r9/build/core/init.mk:555: *** Android NDK: Aborting . Stop.
Android NDK: NDK_TOOLCHAIN is defined to the unsupported value arm-2010q1
Android NDK: Please use one of the following values: arm-linux-androideabi-4.6 arm-linux-androideabi-4.8 arm-linux-androideabi-clang3.2 arm-linux-androideabi-clang3.3 mipsel-linux-android-4.6 mipsel-linux-android-4.8 mipsel-linux-android-clang3.2 mipsel-linux-android-clang3.3 x86-4.6 x86-4.8 x86-clang3.2 x86-clang3.3
Then in config.mk file, I have changed:
TOOLCHAIN_ABIS := armeabi armeabi-v7a
to:
TOOLCHAIN_ABIS := armeabi armeabi-v7a arm-linux-androideabi-4.6
and to:
TOOLCHAIN_ABIS := armeabi armeabi-v7a 4.6
In Application.mk file, Changed:
APP_ABI := armeabi-v7a
to:
APP_ABI := armeabi
and then to:
APP_ABI := arm-linux-androideabi-4.6
Nothing changed. I dint got anything more than this, when I googled it. Does anyone know the solution to this issue. Where can I find arm-2010q1 and how to change it? Any help will be appreciated.
NDK_TOOLCHAIN=arm-2010q1 is passed directly to your ndk-build command, you only need to avoid setting it if you don't have this toolchain and keep the default one.
If you aren't calling the ndk-build script by yourself but from eclipse, you can go into your project properties and revert the C/C++ build settings:

Android NDK: Assertion failure: TARGET_PLATFORM is not defined

When using NDK r5b, when I do a build in my jni directory using
$NDK_DIR/ndk-build
it works fine. But When I switch to r6b (just by setting $NDK_DIR differently) and run that same command, I get
/usr/local/android-ndk-r6b/build/core/setup-toolchain.mk:20: *** Android NDK: Assertion failure: TARGET_PLATFORM is not defined . Stop.
What do I need to do differently in r6b that I didn't need to do in r5b?
The solution is to add this line to jni/Application.mk:
APP_PLATFORM := android-8
This is new to r6b. (Not required in r5b or r6, just r6b.)

Categories

Resources