Include .jnilib in custom Gradle Plugin


(Paul Sprotte) #1

Hey lovely Community,
i’m trying to write an own custom Gradle Plugin for Android. The Plugin uses pngquant to reduce the filesize of all pngs in the drawable folder. In detail it is using the c++ lib from see “Compiling and Linking” -> “To build Java JNI interface run: make java”. On my local machine everything works fine because i set the jnilib insite intellij. But when use the lib from Gradle within an test project it cant find the pngquantlib in the java.library.path. I tried basically everything i could find in the internet and in this forum using the jni keyword in the search. Maybe anyone has a hint to point me in the right direction?
You can also find my project under in the moment without anything i tried like:
sourceSets.main {
jni.srcDirs = []
jniLibs.srcDir ‘src/main/libs’