Android SDK app failed to load library - android

Heyho. I've got the same error message as this guy:
"Android NDK app failed to load library"
and i'm trying to transfer these answers here on my situation for hours now, but it doesnt work.
Can someone help me?
It's this opensource project here, which i want to try to get it run on my emulator.
https://github.com/itskewpie/FreeRDP-android
FreeRDPActivity.java
package net.itskewpie.freerdp;
import android.app.Activity;
import android.os.Bundle;
public class FreeRDPActivity extends Activity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
static {
System.loadLibrary("freerdp");
}
}
freerdp.c
#include <jni.h>
#include <stdio.h>
#include <freerdp/freerdp.h>
jstring Java_net_itskewpie_freerdp_FreeRDPActivity_test(JNIEnv* env, jobject thiz )
{
android_main();
return (*env)->NewStringUTF(env, "HELLO");
}
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
MY_LIBS_PATH=freerdp-1.0-nevo/libs/armeabi-v7a
LOCAL_MODULE := freerdp-utils
LOCAL_SRC_FILES := $(MY_LIBS_PATH)/libfreerdp-utils.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/freerdp-1.0-nevo/include
include $(PREBUILT_STATIC_LIBRARY)
...
Error Message:
FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
java.lang.Class.newInstanceImpl(Native Method)
java.lang.Class.newInstance(Class.java:1319)
android.app.Instrumentation.newActivity(Instrumentation.java:1054)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
android.app.ActivityThread.access$600(ActivityThread.java:141)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:137)
android.app.ActivityThread.main(ActivityThread.java:5041)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:511)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
dalvik.system.NativeStart.main(Native Method)
java.lang.UnsatisfiedLinkError: Couldn't load freerdp from loader dalvik.system.PathClassLoader[dexPath=/data/app/net.itskewpie.freerdp-2.apk,libraryPath=/data/app-lib/net.itskewpie.freerdp-2]: findLibrary returned null
java.lang.Runtime.loadLibrary(Runtime.java:365)
java.lang.System.loadLibrary(System.java:535)
net.itskewpie.freerdp.FreeRDPActivity.<clinit>(FreeRDPActivity.java:16)
... 15 more

try out this open source project:
www.freerdp.com

Did you copy the Android.mk exactly as in the github project? Did you copy the relevant libraries too?
#
## libfreerdp.so
#
include $(CLEAR_VARS)
LOCAL_MODULE := freerdp
LOCAL_SRC_FILES := freerdp.c
LOCAL_ARM_MODE := arm
NDK_TOOLCHAIN_ROOT=/opt/android-toolchain
LOCAL_STATIC_LIBRARIES := freerdp-utils
LOCAL_STATIC_LIBRARIES += freerdp-locale
LOCAL_STATIC_LIBRARIES += freerdp-crypto
LOCAL_STATIC_LIBRARIES += freerdp-sspi
LOCAL_STATIC_LIBRARIES += freerdp-codec
LOCAL_STATIC_LIBRARIES += freerdp-core
LOCAL_STATIC_LIBRARIES += freerdp-cache
LOCAL_STATIC_LIBRARIES += freerdp-gdi
LOCAL_STATIC_LIBRARIES += freerdp-rail
LOCAL_STATIC_LIBRARIES += freerdp-channels
LOCAL_STATIC_LIBRARIES += rdpsnd_alsa
LOCAL_STATIC_LIBRARIES += cliprdr
LOCAL_STATIC_LIBRARIES += rdpsnd
LOCAL_STATIC_LIBRARIES += freerdp_android
In the Java side, it looks like you should load the other libraries as well, in the appropriate order:
static {
System.loadLibrary("freerdp-utils");
System.loadLibrary("freerdp-codec");
System.loadLibrary("freerdp-gdi");
System.loadLibrary("freerdp-core");
System.loadLibrary("freerdp-rail");
System.loadLibrary("freerdp-chche");
System.loadLibrary("freerdp-crypto");
System.loadLibrary("freerdp-sspi");
System.loadLibrary("freerdp-channels");
System.loadLibrary("rdpsnd_alsa");
System.loadLibrary("cliprdr");
System.loadLibrary("rdpsnd");
System.loadLibrary("freerdp_android");
System.loadLibrary("freerdp");
}

Related

Trying to run ButterKnife in AOSP, returning NullPointerException

Trying to test the application with butterknife 8.4.0 and some sample text and I keep getting a NullPointerException The actual code itself is fine but I believe Android.mk might be the issue. So here are the portions of that makefile that are under question:
LOCAL_STATIC_JAVA_LIBRARIES := \
dialer-butterknife-target \
dialer-butterknife-compiler-target \
dialer-butterknife-annotations-target \
PROCESSOR_LIBRARIES_TARGET := \
dialer-auto-value \
dialer-butterknife \
dialer-butterknife-compiler \
dialer-butterknife-annotations \
PROCESSOR_JARS := $(call java-lib-deps, $(PROCESSOR_LIBRARIES_TARGET))
# Necessary for annotation processors to work correctly.
LOCAL_ADDITIONAL_DEPENDENCIES += $(PROCESSOR_JARS)
LOCAL_JACK_FLAGS += --processorpath $(call normalize-path- list,$(PROCESSOR_JARS))
LOCAL_JAVACFLAGS += -processorpath $(call normalize-path-list,$(PROCESSOR_JARS))
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
dialer-butterknife:../../../prebuilts/tools/common/m2/repository/com/jakewharton/butterknife/8.4.0/butterknife-8.4.0.aar \
dialer-butterknife-compiler:../../../prebuilts/tools/common/m2/repository/com/jakewharton/butterknife-compiler/8.4.0/butterknife-compiler-8.4.0$(COMMON_JAVA_PACKAGE_SUFFIX) \
dialer-butterknife-annotations:../../../prebuilts/tools/common/m2/repository/com/jakewharton/butterknife-annotations/8.4.0/butterknife-annotations-8.4.0$(COMMON_JAVA_PACKAGE_SUFFIX) \
include $(CLEAR_VARS)
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_MODULE := dialer-butterknife-target
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/jakewharton/butterknife/8.4.0/butterknife-8.4.0.aar
LOCAL_UNINSTALLABLE_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_MODULE := dialer-butterknife-annotations-target
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/jakewharton/butterknife-annotations/8.4.0/butterknife-annotations-8.4.0$(COMMON_JAVA_PACKAGE_SUFFIX)
LOCAL_UNINSTALLABLE_MODULE := true
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_MODULE := dialer-butterknife-compiler-target
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := ../../../prebuilts/tools/common/m2/repository/com/jakewharton/butterknife-compiler/8.4.0/butterknife-compiler-8.4.0$(COMMON_JAVA_PACKAGE_SUFFIX)
LOCAL_UNINSTALLABLE_MODULE := true
include $(BUILD_PREBUILT)
Here is the error in stack trace:
07-06 09:38:28.690 24980 24980 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.dialer/com.android.dialer.about.LicenseMenuActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
07-06 09:38:28.690 24980 24980 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference

Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing in AOSP Build

Hi all I am using jni code to generate some number in my application. When I install and run it on my device it is working fine as expected with jni code, but when I am creating AOSP build flashing system.img and boot.img in my device getting UnsatisfiedLinkError at run time for jni code.
My Project structure, code snippet and logcat is given below
Below code is for JNI Wrapper class
RandomGenerator.java
public final class RandomGenerator {
private RandomGenerator() {}
public static native String getNumber(String code);
/***
* load native library in static initializer
*/
static
{
System.loadLibrary("code-generator");
}
}
Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := code-generator
LOCAL_SRC_FILES := $(call all-cpp-files-under, samplecode/src/main/jni)
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
include $(BUILD_SHARED_LIBRARY)
Application.mk
APP_ABI := armeabi armeabi-v7a arm64-v8a
build.gradle
defaultConfig {
applicationId "com.jni.test.service"
minSdkVersion project.ext.minSdkVersion
targetSdkVersion project.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.config
multiDexEnabled true
ndk{
moduleName "code-generator"
}
}
sourceSets.main.jniLibs.srcDirs = ['./src/main/jni/']
externalNativeBuild {
// Encapsulates your CMake build configurations.
cmake {
// Provides a relative path to your CMake build script.
path "/src/main/jni/CMakeLists.txt"
}
}
And below on main application Android.mk code snippet.
Android.mk
#Building JNI library for Code generator
include $(CLEAR_VARS)
LOCAL_MODULE := code-generator
LOCAL_SRC_FILES := $(call all-cpp-files-under, samplecode/src/main/jni)
include $(BUILD_SHARED_LIBRARY)
#Build JNI library end
#Building sample application
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS :=optional
LOCAL_SRC_FILES := $(call all-java-files-under, samplecode/src/main/java)
LOCAL_RESOURCE_DIR :=$(LOCAL_PATH)/samplecode/src/main/res
LOCAL_ASSET_DIR := $(LOCAL_PATH)/samplecode/src/main/assets
LOCAL_MANIFEST_FILE := samplecode/src/main/AndroidManifest.xml
LOCAL_PACKAGE_NAME := samplecode
LOCAL_SHARED_LIBRARIES := code-generator
LOCAL_SDK_VERSION := current
LOCAL_CERTIFICATE :=platform
LOCAL_PROGUARD_ENABLED := disabled
include $(BUILD_PACKAGE)
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := j2xx:mylib/libs/j2xx.jar
include $(BUILD_MULTI_PREBUILT)
#Building sample application end
Now the problem is when I run android application with this code it is working fine as expected jni code, even AOSP build successfully completed. But When I flash AOSP build I getting
UnsatisfiedLinkError at runtime.
09-16 20:32:09.780 10782-10782/com.jni.test.service W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/jni/test/service/sample/RandomGenerator;
09-16 20:32:09.780 10782-10782/com.jni.test.service D/AndroidRuntime: Shutting down VM
09-16 20:32:09.780 10782-10782/com.jni.test.service W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xb0cdcb20)
09-16 20:32:09.790 10782-11129/com.jni.test.service I/path: /data/data/com.jni.test.service/files/config.xml
09-16 20:32:09.800 10782-10782/com.jni.test.service E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.jni.test.service, PID: 10782
java.lang.UnsatisfiedLinkError:
Couldn't load code-generator from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.jni.test.samplecode-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.jni.test.samplecode-2, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.jni.test.service.sample.RandomGenerator.<clinit>(Random.java:40)
at com.jni.test.service.MainActivity.onCreate(MainActivity.java:101)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Note: After AOSP build .so file creating related to code-generator but
not finding path in application, I believe something went wrong with
Android.mk configuartion. Please can someone help me on this.
Thanks in advance.

NDK - call a native function from .so file

I wrote a sample shared library in VS 2015 (NDK Cross Platform project)
Common.h:
#ifdef __cplusplus
extern "C" {
#endif
int first(int x, int y);
#ifdef __cplusplus
}
#endif
Common.cpp:
#include "Common.h"
int first(int x, int y)
{
return x + y;
}
so now i have a .so file and i want to create a project in Android Studio which link against that .so file and call first(x,y) with JNI.
hello_jni.c:
#include "Common.h"
#include <jni.h>
jint
Java_com_test_MainActivity_add( JNIEnv* env,
jobject thiz,
jint a,
jint b)
{
return (jint)first((int)a,(int)b);
}
So I put libCommon.so and Common.h in jni folder of the project
edited the android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := libCommon.so
LOCAL_MODULE := add_prebuilt
LOCAL_EXPORT_C_INCLUDES := Common.h
include $(PREBUILT_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog
LOCAL_ALLOW_UNDEFINED_SYMBOLS := true
LOCAL_C_INCLUDES := $(LOCAL_PATH)
LOCAL_SRC_FILES := hello_jni.c
LOCAL_MODULE := hello_jni
LOCAL_SHARED_LIBRARIES := add_prebuilt
include $(BUILD_SHARED_LIBRARY)
(I added LOCAL_ALLOW_UNDEFINED_SYMBOLS := true since I got an error undefined reference to 'first')
Application.mk:
APP_ABI := armeabi-v7a
So now I have two .so files in src\main\libs\armeabi-v7a.
The application is crashed when I load libhello_jni.so
and it isn't crashed for loading libCommon.so
static
{
System.loadLibrary("Common");
System.loadLibrary("hello_jni");
}
Error log:
02-03 12:52:52.509 9685-9685/com.test E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.test, PID: 9685
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "first" referenced by "libhello_jni.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:364)
at java.lang.System.loadLibrary(System.java:526)
at com.test.MainActivity.<clinit>(MainActivity.java:23)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
I don't know what to do ... Why first function not found ?
Any ideas?
Thanks!

Android App crashs and show UnsatisfiedLinkError

I try run an Android application using ndk, i can build the library, but when i run give a exception.
follow the codes and error for help the solution
i use c code, instead cpp
primitive.c
#include <jni.h>
#include <android/log.h>
JNIEXPORT jboolean JNICALL Java_cookbook_chapter2_PassingPrimitiveActivity_passBooleanReturnBoolean(JNIEnv *pEnv, jobject pObj, jboolean pBooleanP){
__android_log_print(ANDROID_LOG_INFO, "native", "%d in %d bytes", pBooleanP, sizeof(jboolean));
return (!pBooleanP);}
Acitivity class: PassingPrimitiveActivity.java
public class PassingPrimitiveActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_passing_primitive);
StringBuilder strBuilder = new StringBuilder();
strBuilder.append("boolean: ").append(passBooleanReturnBoolean(false))");;
TextView tv = (TextView) findViewById(R.id.display_res);
tv.setText(strBuilder.toString());
}
private native boolean passBooleanReturnBoolean(boolean p);
static {
System.loadLibrary("PassingPrimitive");
} }
logcat file, with error. Show that don't have implementation, but in c code, have it
06-11 17:08:30.652 29603 29603 E AndroidRuntime: FATAL EXCEPTION: main
06-11 17:08:30.652 29603 29603 E AndroidRuntime: java.lang.UnsatisfiedLinkError: Native method not found: cookbook.chapter2.passingprimitive.PassingPrimitiveActivity.passBooleanReturnBoolean:(Z)Z
06-11 17:08:30.652 29603 29603 E AndroidRuntime: at cookbook.chapter2.passingprimitive.PassingPrimitiveActivity.passBooleanReturnBoolean(Native Method)
06-11 17:08:30.652 29603 29603 E AndroidRuntime: at cookbook.chapter2.passingprimitive.PassingPrimitiveActivity.onCreate(PassingPrimitiveActivity.java:15)
06-11 17:08:30.652 29603 29603 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5184)
my Android.mk seens like it:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := PassingPrimitive
LOCAL_SRC_FILES := primitive.c
LOCAL_LDLIBS := -llog
include $(BUILD_SHARED_LIBRARY)
Everything compiles fine, creates a .so file and copies to the libs folder under my project, but when I run, logcat show UnsatisfiedLinkError and the app crash
What i can do for solve it?
Try generating a proper C header file from your compiled java code, like this:
javah -jni -classpath bin/classes com.whatever.PassingPrimitiveActivity
then include that header file in your C code. The function you define in C should match the one in the header file. The mapping is not always what you assume.
Your logcat suggests that the native function name should be
Java_cookbook_chapter2_passingprimitive_PassingPrimitiveActivity_passBooleanReturnBoolean

std::map linker error ndk r8c with APP_STL := gnustl_static

I have some problem linking the STL in my Native application. Linking fails with both map::operator[] and map::insert while succeeds with other map functions.
My Application.mk is :
APP_STL := gnustl_static
APP_CPPFLAGS := -fexceptions -frtti
APP_CPPFLAGS += -g3
APP_CPPFLAGS += -DDEBUG
APP_ABI := armeabi-v7a
APP_PLATFORM:=android-14
NDK_TOOLCHAIN_VERSION:=4.6
The native code contains two folder level. I created for each internal folder an Android.mk file to compile and generate a static library. I'm using std::map in the deepest folder. Android.mk looks like:
TEMP_PATH_REG := $(call my-dir)
LOCAL_PATH := $(TEMP_PATH_REG)
include $(call all-subdir-makefiles)
LOCAL_PATH := $(TEMP_PATH_REG)
include $(CLEAR_VARS)
LOCAL_MODULE := registration
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../glm/
LOCAL_SRC_FILES := registration_factory.cpp \
inertial.cpp
LOCAL_LDLIBS := -llog -landroid -lEGL
LOCAL_STATIC_LIBRARIES := android_native_app_glue
include $(BUILD_STATIC_LIBRARY)
$(call import-module,android/native_app_glue)
When I build the project i get the following errors:
~/.android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi-v7a/libregistration.a(registration_factory.o): in function std::_Rb_tree<int, std::pair<int const, xmar::IRegistration*>, std::_Select1st<std::pair<int const, xmar::IRegistration*> >, std::less<int>, std::allocator<std::pair<int const, xmar::IRegistration*> > >::_M_insert_(std::_Rb_tree_node_base const*, std::_Rb_tree_node_base const*, std::pair<int const, xmar::IRegistration*> const&):~/.android-ndk-r8c/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/stl_tree.h:1013: error: undefined reference to 'std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)'
StaticLibrary : libandroid_native_app_glue.a
rm -f obj/local/armeabi-v7a/libandroid_native_app_glue.a
~/.android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi-v7a/libregistration.a(registration_factory.o): in function std::_Rb_tree_const_iterator<std::pair<int const, xmar::IRegistration*> >::operator--():~/.android-ndk-r8c/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/stl_tree.h:284: error: undefined reference to 'std::_Rb_tree_decrement(std::_Rb_tree_node_base const*)'
~/.android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-ar crs ./obj/local/armeabi-v7a/libandroid_native_app_glue.a ./obj/local/armeabi-v7a/objs-debug/android_native_app_glue/android_native_app_glue.o
~/.android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi-v7a/libregistration.a(registration_factory.o): in function std::_Rb_tree_const_iterator<std::pair<int const, xmar::IRegistration*> >::operator++():~/.android-ndk-r8c/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/stl_tree.h:269: error: undefined reference to 'std::_Rb_tree_increment(std::_Rb_tree_node_base const*)'
Prebuilt : libgnustl_static.a <= <NDK>/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/
~/.android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi-v7a/libregistration.a(registration_factory.o): in function std::_Rb_tree_iterator<std::pair<int const, xmar::IRegistration*> >::operator--():~/.android-ndk-r8c/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/stl_tree.h:203: error: undefined reference to 'std::_Rb_tree_decrement(std::_Rb_tree_node_base*)'
What I'm doig wrong?
Thanks a lot.
I found a workaround to compile the project.
LOCAL_LDLIBS += ~/.android-ndk-r8c/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libsupc++.a
LOCAL_LDLIBS += ~/.android-ndk-r8c/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/libgnustl_static.a

Categories

Resources