Using SDK and JavaWrapper in Android Studio


Hello everyone,

I’m trying to use the the Indy SDK for building an android app. Unfortunately I can’t get the Android Studio to install the app. My steps on a Windows 10 machine:

  1. download the libindy/stable/1.8.2/ from evernym (
  2. copying the to app\src\main\jniLibs\x86
  3. adding to build.gradle
    maven {url '} and
    api ‘org.hyperledger:indy:1.8.1-dev-985’
  4. set compileOptions to Java 8 in build.gradle
  5. try to install the app on an x86 emulator, without using any wrapper class
  6. android studio tries to install the app for about 5min and nothing happens

What am I missing?


After some more time wating the app got installed. I tried to open a pool from the onCreate() and got a NullPointerException. So I guess I did somethin wrong when installing the

Caused by: java.lang.NullPointerException: Attempt to invoke interface method ‘int org.hyperledger.indy.sdk.LibIndy$API.indy_open_pool_ledger(int, java.lang.String, java.lang.String, com.sun.jna.Callback)’ on a null object reference


I think you may have better luck asking this type of question on Rocket Chat (, #indy-sdk). Internal developers tend to hang out more in that forum. Here, there are more people that work at a higher level in the stack.


Hello Daniel, thanks :slight_smile:

I posted the question to chat.hyperledger, but I solved the issue meanwhile. I’ll keep an eye on the chat, maybe there is a better way to solve it.
For whose who face the same problem, here is what I did to get libindy 1.8.2 working in android:

  1. download the NDK16b from here:
    The for indy-sdk ( says, that NDK16b has been used for compiling the dependencies .

  2. extract the NDK and copy into the appropriate JniLibs folder. It is located here:

  3. download jna-5.2.0 from here and extract it

  4. in jna-5.2.0\lib\native there are some .jar - files for your plattform. Open the appropriate .jar and extract from it. Copy to the appropriate jniLibs subfolder.

  5. add implementation ‘’ to the dependencies of your app’s build.gradle. Without it I get the following error and the app doesnt launch.
    There is an incompatible JNA native library installed on this system
    Expected: 5.1.0
    Found: 6.0.0


I had the same issue, but solved it by downloading the jar file from the lib files in the repository under the 5.2 tag

Would you mind sharing a piece of your graddle file? I am trying to add the maven repo into my android project but keep on getting the error

Could not resolve org.hyperledger:indy:1.8.1-dev-985

Even though I already set the repository as
maven { url ‘’ }


apply plugin: ‘’

repositories {
maven { url ‘’ }

android {
compileSdkVersion 28
defaultConfig {
applicationId “com.example.emutest”
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName “1.0”
testInstrumentationRunner “”
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile(‘proguard-android-optimize.txt’), ‘’

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8


dependencies {
implementation fileTree(dir: ‘libs’, include: [’*.jar’])
implementation ‘’
implementation ‘’
testImplementation ‘junit:junit:4.12’
androidTestImplementation ‘’
androidTestImplementation ‘’

api 'org.hyperledger:indy:1.8.1-dev-985'
implementation ''
implementation ''



To resolve org.hyperledger:indy:1.8.1-dev-985 you need to add
maven { url ‘’ }