标签:android studio 引入 so文件 lib libs 库文件
方法一:
将libs文件夹下的so文件,通过gradle配置任务编译成jar文件。
apply plugin: ‘com.android.library‘ android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion defaultConfig { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion } /** 导入so文件 */ task nativeLibsToJar(type: Zip, description: "create a jar archive of the native libs") { destinationDir file("$projectDir/libs") baseName "Native_Libs2" extension "jar" from fileTree(dir: "libs", include: "**/*.so") into "lib" } tasks.withType(JavaCompile) { compileTask -> compileTask.dependsOn(nativeLibsToJar) } } dependencies { provided fileTree(dir: ‘libs‘, include: [‘*.jar‘]) }
参考资料:http://blog.csdn.net/wulianghuan/article/details/44567001
本文出自 “天空没有痕迹但我飞过” 博客,请务必保留此出处http://glblong.blog.51cto.com/3058613/1694567
标签:android studio 引入 so文件 lib libs 库文件
原文地址:http://glblong.blog.51cto.com/3058613/1694567