0

I am building a .aar Library that is partially written in C++ and uses OpenCV.

When i am assembling the Library i get a .aar with everything included and i can import it into a different project. When building the project i get the error, that i still need the correct ndk in the project which imports the .aar. This is not good if i want to give the library to others.

Shouldn't the JNI part of the library already be compiled so i don't need the NDK if i already have the .aar? How can i remove the dependency from the .aar?

Edit:

The Error is No version of NDK matched the requested version 20.0.5594570. Versions available locally: 17.3.6528147, 21.0.6113669

I include the .aar by putting it in the libs/ folder in the module and adding '*.aar' to the build.gradle fileTree implementation.

1 Answers1

0

The reason for it was the automatic stripping of the native part of my library.

Explaination here: https://stackoverflow.com/a/62320616/4284799

Solution 1: Change gradle version in the projects build.gradle

dependencies {
    classpath 'com.android.tools.build:gradle:3.5.0'
}

Solution 2: install a ndk and set it in the local.properties

ndk.dir=/path/to/android-sdk/ndk-bundle