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:
Related
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"
I am trying to build my native application using ndk-build. Suppose I followed this guide to create my Android project:
https://rathodpratik.wordpress.com/2013/03/24/build-cc-executables-for-android-using-ndk/
When I try to print out my TARGET_ARCH_ABI, I always get armeabi. Even if I explicitly set
TARGET_ARCH_ABI := armeabi-v7a
The application always builds into the libs/armeabi directory and when I check the elf header, it does in fact show that it has built for ARM.
How can I get it to build for armeabi-v7a?
Same problem but i actually managed to fix it, i restricted my build.gradle(module) to build only for certain abi, with:
defaultConfig {
ndk {
abiFilters 'armeabi-v7a'
}
}
and Application.mk:
API_ABI := armeabi-v7a
I had the exact same problem and I couldn't locate the cause either. However, I fixed it by putting:
TARGET_ARCH_ABI := armeabi-v7a
at the very beginning of Android.mk.
Hope this helps
We have an Android NDK project that has three different build configurations:
DEBUG - armeabi
DEBUG - armeabi-v7a
RELEASE - aremabi + armeabi-v7a
We specify separate aremabi and armeabi-v7 debug configurations due to a known bug in the Android loader, where if more than one EABI is specified, the debugger may launch the wrong EABI version of the App and no native breakpoints will ever hit (More details here, at the end of the document).
On the past, we edited the Application.mk file and specified the desired EABI by means of the APP_ABI variable.
We would like to avoid this manual editing and take advantage of Eclipse's Build Configurations and choose the proper EABI setting automatically.
So far, we have a working solution by adding conditionals to the Application.mk file
Here is how our Application.mk looks:
ifeq ($(BUILD_CONFIG),RELEASE)
APP_OPTIM := release
APP_ABI := armeabi armeabi-v7a
else ifeq ($(BUILD_CONFIG),ARMEABIV7A_DEBUG)
APP_OPTIM := debug
APP_ABI := armeabi-v7a
else ifeq ($(BUILD_CONFIG),ARMEABI_DEBUG)
APP_OPTIM := debug
APP_ABI := armeabi
endif
Additionally, we customised the compiler build command line in Eclipse so that the proper BUILD_CONFIG variable is passed to the make script.
This works very well for compilation purposes, but the problem begins when we try to debug the application. The thing is that we don't know how to pass the BUILD_CONFIG variable to the ndk-gdb script.
Running the ndk-build DUMP_APP_ABI command will always return ARMEABI (expected since we are not explicitly defining the BUILD_CONFIG parameter), and as far as I understand, this is the value that ndk-gdb is reading in order to decide which version of the application will be launched by the debugger.
Has anyone managed to get this working or have an alternative solution where we can get compilation and debugging working properly with Eclipse's Build Configurations? Running a command that patches or renames the Application.mk file is a possibility, but we don't know how to do that either.
Android 4.0 has bug. If you provide armeabi and armeabi-v7a code then armeabi code is loaded even if you have ARMv7 compatible CPU. Android 4.0 ignores armeabi-v7a when armeabi is available.
That is why you can create 2 versions of your lib targeted to armeabi (ARMv5)
But there is no ARMv5 CPUs (HTC Hero)
So most CPUs are ARMv6 or ARMv7
You should detect your CPU in Java and load proper native lib.
Doing these will give you control what .so loaded exactly.
You would be able to create lib with NEON support.
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.)
I downloaded and installed Android-NDK on my Archlinux, using this package.
Got no issues building (and running) the sample hello-jni following the guide on this page, but if I try to do the same with hello-gl2 I get some errors; it looks like it cannot find some header files:
$ ../../ndk-build
/usr/bin/make -f /opt/android-ndk/build/core/build-local.mk
Compile++ thumb : gl2jni <= gl_code.cpp
/opt/android-ndk/samples/hello-gl2/jni/gl_code.cpp:22:23: error: GLES2/gl2.h: No such file or directory
/opt/android-ndk/samples/hello-gl2/jni/gl_code.cpp:23:26: error: GLES2/gl2ext.h: No such file or directory
--- SNIP ---
GLES2/gl2.h and GLES2/gl2ext.h are however present in $(NDK)/platforms/android-4/arch-arm/usr/include/, and it looks like$(NDK)/build/core/setup-toolchain.mk should set such include path.
Has anybody encountered the same issue? How can I compile this sample?
And then, are there other options to easily build Android-NDK applications? This build system seems quite complicated to me, and I'd prefer using cmake to build my applications.
make sure that APP_ABI and APP_PLATFORM is defined in your Application.mk and your APP_PLATFORM should be higher than android-5... check: gl.h & glext.h not found
for example, in Application.mk define:
APP_ABI := armeabi #armeabi-v7a
APP_STL := stlport_static
APP_PLATFORM := android-8
In my case it was missing the file default.properties with such content:
target=android-5
Put this file into the root project directory. It may help.
You need to use a higher SDK. Level 5 is the minimum to build OpenGL ES 2 code.