Skip to content Skip to sidebar Skip to footer

What Is The Magic Of Nativelibstojar

The following code snippet seems to be the answer how to include native libraries with Android Studio: task nativeLibsToJar(type: Zip, description: 'create a jar archive of the nat

Solution 1:

That's really funny - I found this as solution so many times:

task nativeLibsToJar(type: Zip, description: 'create a jar archive of the native libs') {
    destinationDir file("$buildDir/native-libs")
    baseName 'native-libs'
    extension 'jar'fromfileTree(dir: 'libs', include: '**/*.so')
    into 'lib/'
}

But it can be removed because it does nothing useful (maybe it did in older build-versions).

The real trick is done through sourceSets.main.jniLibs.srcDir 'src/main/libs/' //integrate your libs from libs instead of default dir 'jniLibs

Post a Comment for "What Is The Magic Of Nativelibstojar"