Questions tagged [android-ndk]

The Android Native Development Kit (NDK) is a companion tool to the Android SDK that lets build performance-critical portions of apps in native code or port existing libraries in C/C++ to Android. It provides headers and libraries that allows to build activities, handle user input, use hardware sensors, access application resources, and more, when programming in C/C++.

Android NDK applications that include Java code and resource files and and/or source code (and sometimes code). All native code is compiled into a dynamic linked library (.so file) and then called by Java in the main program using a mechanism:

Android NDK Application

The NDK is a powerful tool for developing Android applications because it:

  • Builds performance-critical portions of your applications in native code. When using Java code, the Java-based source code needs to be interpreted into machine language using a virtual machine. In contrast, the native code is compiled and optimized into binary directly before execution. With proper use of native code, you can build high performance code in your application, such as hardware video encoding and decoding, graphics processing, and arithmetical operation.
  • Reuses legacy native code. C/C++ codes can be compiled into a dynamic library that can be called by Java code with a JNI mechanism.

More information:

Latest Version: NDK Downloads

Version History: NDK Archives

Resources:

FAQ:

Books:

13539 questions
313
votes
32 answers

Android Fatal signal 11 (SIGSEGV) at 0x636f7d89 (code=1). How can it be tracked down?

I've been reading the other posts on tracking down the reasons for getting a SIGSEGV in an Android app. I plan to scour my app for possible NullPointers related to Canvas use, but my SIGSEGV barfs up a different memory address each time. Plus I've…
dubmojo
  • 6,660
  • 8
  • 41
  • 68
277
votes
55 answers

Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

I want to compile an open source android project (Netguard) using gradel (gradlew clean build) But I encountered this Error: A problem occurred configuring project ':app'. > Exception thrown while executing model rule:…
Saeed
  • 7,262
  • 14
  • 43
  • 63
270
votes
1 answer

How to affect Delphi XEx code generation for Android/ARM targets?

Update 2017-05-17. I no longer work for the company where this question originated, and do not have access to Delphi XEx. While I was there, the problem was solved by migrating to mixed FPC+GCC (Pascal+C), with NEON intrinsics for some routines…
Side S. Fresh
  • 3,015
  • 2
  • 16
  • 18
241
votes
25 answers

No version of NDK matched the requested version

After updating to Android Gradle plugin 3.6.0 (released Feb 24, 2020), several project independently started failing with: No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669 It's quite simple to…
193
votes
44 answers

java.lang.ClassNotFoundException: Didn't find class on path: dexpathlist

I'm currently working on a project in which I have to use purely native ndk. It worked when I try running an helloworld example from Irrlicht engine source. Then I try using it in my project following the same format of that example. But I…
Karthik Sivam
  • 2,505
  • 3
  • 18
  • 24
158
votes
11 answers

Where do I find old versions of Android NDK?

Does anyone know where I can find older versions of the Android NDK? Our code doesn't build with r6. Surely there must be archived versions somewhere.
lest
  • 1,589
  • 2
  • 10
  • 4
157
votes
23 answers

Android studio, gradle and NDK

I am very new to this whole gradle and Android Studio support. I have managed to convert my android project to gradle using the export option. But I am looking for some documentation or start point how to integrate the NDK build into the gradle…
plaisthos
  • 6,255
  • 6
  • 35
  • 63
146
votes
3 answers

Why use armeabi-v7a code over armeabi code?

In my current project I make use of multiple .so files. These are located at the armeabi and armeabi-v7a folder. Unfortunately one of the .so files is a 6MB and I need to reduce file size. Instead of having a fat APK file, I would like to use just…
PaulT
  • 1,797
  • 2
  • 12
  • 13
127
votes
6 answers

Running Node.Js on Android

So I know this has been questioned quite a lot. To be exact for example in these questions: Run NodeJs server in Android How to run my node.js project on android? and NodeJS on IOS/Android Every option presented has a problem though: I want…
MariusR
  • 1,534
  • 2
  • 11
  • 20
112
votes
16 answers

Unable to find CMake in Android Studio

I need to add C/C++ code in my Android program for which I needed LLDB, CMake, and NDK. I found LLDB and NDK in SDK manager, but CMake is missing from there. I tried manually downloading it from the CMake official site and found out that for Android…
ashish mishra
  • 1,401
  • 2
  • 10
  • 13
112
votes
14 answers

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…
user842225
  • 5,445
  • 15
  • 69
  • 119
111
votes
4 answers

What causes signal 'SIGILL'?

I'm porting some C++ code to Android using NDK and GCC. The code basically runs. At one point, when debugging in Eclipse, the call Dabbler::Android::Factory* pFactory = new Dabbler::Android::Factory; causes this error: Thread [1] (Suspended: Signal…
Dabbler
  • 9,733
  • 5
  • 41
  • 64
106
votes
16 answers

undefined reference to `__android_log_print'

What is wrong with my make file? Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := foo LOCAL_SRC_FILES := foo.c LOCAL_EXPORT_LDLIBS := -llog include $(BUILD_SHARED_LIBRARY) foo.c #include #include…
alex2k8
  • 42,496
  • 57
  • 170
  • 221
105
votes
31 answers

NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN error

After updating Android Studio and Gradle to 3.5, I now get this error: NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN I changed the Gradle version in build-gradle back to 3.4.2 but it didn't help.
Farhad Farzin
  • 1,239
  • 2
  • 9
  • 12
99
votes
11 answers

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) { …
Patrick Kafka
  • 9,795
  • 3
  • 29
  • 44
1
2 3
99 100