- 首页 > it技术 > >
找不到so文件|找不到so文件 将so文件放到app-libs下面 然后加上下面打包jar即可
apply plugin: 'com.android.application'android {
compileSdkVersion 26
defaultConfig {
applicationId "com.fberase"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}task nativeLibsToJar(type: Zip, description: "create a jar archive of the native libs") {
destinationDir file("$projectDir/libs")
baseName "Native_Libs"
extension "jar"
from fileTree(dir: "libs", include: "**/*.so")
into "lib"
}tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(nativeLibsToJar)
}buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}}dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile files('libs/Native_Libs.jar')///此句第一次用的时候注释掉 编出来jar包后再加上
}
推荐阅读