How to use addr2line in Android

Let’s say that logcat show you the following crash log (this is from one of my projects): I/DEBUG ( 31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** I/DEBUG ( 31): Build fingerprint: ‘generic/sdk/generic:2.3/GRH55/79397:eng/test-keys’ I/DEBUG ( 31): pid: 378, tid: 386 >>> com.example.gltest <<< I/DEBUG ( 31): … Read more

Can’t include C++ headers like vector in Android NDK

It is possible. Here is some step by step: In $PROJECT_DIR/jni/Application.mk: APP_STL := stlport_static I tried using stlport_shared, but no luck. Same with libstdc++. In $PROJECT_DIR/jni/Android.mk: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := hello-jni LOCAL_SRC_FILES := hello-jni.cpp LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) Nothing special here, but make sure your files are .cpp. In $PROJECT_DIR/jni/hello-jni.cpp: … Read more

After updating Android Studio to version 1.3.0 I am getting “NDK integration is deprecated in the current plugin” Error

Here is how to solve this issue : add gradle.properties file to root folder of your project add ‘android.useDeprecatedNdk=true’ to gradle.properties file Here is my gradle.properties : # Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. # For … Read more

How can I catch SIGSEGV (segmentation fault) and get a stack trace under JNI on Android?

Edit: From Jelly Bean onwards you can’t get the stack trace, because READ_LOGS went away. 🙁 I actually got a signal handler working without doing anything too exotic, and have released code using it, which you can see on github (edit: linking to historical release; I removed the crash handler since then). Here’s how: Use … Read more

Calling a java method from c++ in Android

If it’s an object method, you need to pass the object to CallObjectMethod: jobject result = env->CallObjectMethod(obj, messageMe, jstr); What you were doing was the equivalent of jstr.messageMe(). Since your is a void method, you should call: env->CallVoidMethod(obj, messageMe, jstr); If you want to return a result, you need to change your JNI signature (the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)