I have two projects A and B.
A is a main project, that use B thought dependency A->B
NDK libs located in two projects :
-------------- --------------
| A | | B |
-------------- --------------
| JNI libs | | JNI libs |
-------------- --------------
A
|-jniLibs
|-armeabi-v7a
|-x86
B
|-jniLibs
|-armeabi-v7a
|-x86
And I try to include JNI into both projects :
Piece of build.gradle from A :
...
sourceSets {
main {
jni.srcDirs = []
jniLibs.srcDirs = ['jniLibs']
}
}
splits {
abi {
enable true
reset()
include 'x86', 'armeabi-v7a'
universalApk true
}
}
productFlavors {
x86 {
ndk {
abiFilters "x86", ""
}
}
arm7 {
ndk {
abiFilters "armeabi-v7a", ""
}
}
}
...
Piece of build.gradle from B :
...
sourceSets {
main {
jni.srcDirs = []
jniLibs.srcDirs = ['jniLibs']
}
}
splits {
abi {
enable true
reset()
include 'x86', 'armeabi-v7a', 'mips'
universalApk true
}
}
productFlavors {
x86 {
ndk {
abiFilters "x86", ""
}
}
arm7 {
ndk {
abiFilters "armeabi-v7a", ""
}
}
}
...
And when I try to launch my App I've got an error about missing implementation of method from JNI lib. You can say that jni lib doesn't contains the method, but if I put all .so
files to A project and try use the lib from B project - I doesn't have any error.
So the question is : how to locate directly JNI lib path in gradle?