Tag: android-ndk

Android NDK: No rule to make target

I’m trying to build a simple Android application using NDK. Here are the contents of my Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_LDLIBS := -llog LOCAL_MODULE := myNDK LOCAL_SRC_FILES := native.c include $(BUILD_SHARED_LIBRARY) And when I’m running ndk-build I get: make: * No rule to make target ‘/native.c’, needed by ‘/Users/ivan/Documents/workspace/TestNDK/obj/local/armeabi/objs/myNDK/native.o’. Stop. So the […]

System.loadLibrary(…) couldn't find native library in my case

I want to use a existing native library from another Android project, so I just copied the NDK built library (libcalculate.so) to my new Android project. In my new Android project I created a folder libs/armeabi/ and put libcalculate.so there. There is no jni/ folder. My testing device has ARM architecture. In my java code […]

Error in final launch sequence Failed to execute MI command -gdb-set target-async off

I have two projects on eclipse, one produces an so and the other is Android application which uses it I am trying to debug the native code in the so using this guide. I set my application debuggable I started my application in the debug mode I run ndk-gdb When I run the native debugger […]

Android.mk, include all cpp files

I’m trying to build an Android project using the ndk, but I have run into some troubles. Here’s the Android.mk file that works: LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := mylib LOCAL_CFLAGS := -Werror LOCAL_SRC_FILES := main.cpp, Screen.cpp, ScreenManager.cpp LOCAL_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) Is there a way that allows me to specify all the […]

How to detect compilation by android ndk in a C/C++ file?

Is there a preprocessor macro that will let me know ndk is compiling my code? I could manually define my own, but I’d rather not if possible.

ffmpeg for a android (using tutorial: “ffmpeg and Android.mk”)

I am trying to compile ffmpeg for a android. I have found several posts on this theme but non of these seems to work. If tried to build ffmpeg like it is posted on [1]. Did anybody successfully compile ffmpeg using theses tutorial? I am not sure how to realize step 4 to 5. STEP4: […]

Running a native library on Android L. error: only position independent executables (PIE) are supported

When I run native code on Android L (Nexus 5), I get the error. error: only position independent executables (PIE) are supported. The same code is executed correctly on my Samsung Galaxy S3 (Android 4.3). Here is my Application.mk APP_PROJECT_PATH := $(call my-dir)/.. APP_ABI := armeabi NDK_TOOLCHAIN_VERSION := 4.7 APP_PLATFORM := android-9 APP_GNUSTL_FORCE_CPP_FEATURES := exceptions […]

What is sharedUserId in Android, and how is it used?

I am confused in sharedUserID.what is use of sharedUserId?How to use?Where to use in android?

Any simple or easy way to debug Android NDK code?

I’m looking for a way to easily debug C code in an Android NDK application using Eclipse. I’ve read ways to debug the app using gdb or something similar but what I want is a way to push messages to Eclipse somehow. I’m looking for a solution that’s as simple as using a print function […]

Android NDK C++ JNI (no implementation found for native…)

I’m trying to use the NDK with C++ and can’t seem to get the method naming convention correct. my native method is as follows: extern “C” { JNIEXPORT void JNICALL Java_com_test_jnitest_SurfaceRenderer_drawFromJni (JNIEnv* env, jclass c) { // } } with a header wrapped in extern “C” {} aslo. Everything compiles fine, creates a .so file […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.