? ? 首先将so库放到libs下的对应目录下,如没有armeabi目录就创建下。
? ? 然后在工程里面的build.gradle中添加如下代码
task copyNativeLibs(type: Copy) { from fileTree(dir: 'libs', include: 'armeabi/*.so') into 'build/lib' } tasks.withType(Compile) { compileTask -> compileTask.dependsOn copyNativeLibs } clean.dependsOn 'cleanCopyNativeLibs' tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask -> pkgTask.jniFolders = [new File(buildDir, 'lib')] }
?