关于进入.so库文件,导致的findLibrary returned null问题

解决办法:

在gradle文件中加入以下代码片段:


task copyNativeLibs(type: Copy) {
    from(new File('libs')) { include '**/*.so' }
    into new File(buildDir, 'native-libs')
}


tasks.withType(Compile) { compileTask -> compileTask.dependsOn copyNativeLibs }


clean.dependsOn 'cleanCopyNativeLibs'


tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask ->
    pkgTask.jniDir new File(buildDir, 'native-libs')
}


你可能感兴趣的:(关于进入.so库文件,导致的findLibrary returned null问题)