如何解决第三方 jar 文件中的 .so共享库不会进入 android studio 中的 apk 其他所有内容都进入它
我在多级子目录下有一个第三方 jar 文件,其中包含 .so 文件、dll 文件、数据文件和 java 类文件。当我在 Android Studio 中构建 apk 时,它会提取除 .so 文件之外的所有其他内容。如果我将 .so 文件的扩展名更改为 .so.1(使用 jar 实用程序提取第三方 jar 文件以更改扩展名),它会将其拉入。
这是我的 build.gradle 文件:
plugins {
id 'com.android.application'
}
android {
compileSdkVersion 30
buildToolsVersion '29.0.3'
defaultConfig {
applicationId "com.example.apicatjnovas"
minSdkVersion 16
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
splits {
abi {
enable true
reset()
include 'x86','armeabi-v7a','mips'
universalApk false
}
}
ndkVersion '22.1.7171670'
dependenciesInfo {
includeInApk true
includeInBundle true
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
debug {
renderscriptOptimLevel 3
}
}
}
dependencies {
implementation fileTree(dir: 'libs',include: ['.jar','.so'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation files('libs/jnovas_hp.jar')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
ndk 版本 - 21.1.6352462
任何帮助将不胜感激。 谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。