android - 第三方 jar 文件中的 .so(共享库)无法进入 android studio 中的 apk 其他所有内容都进入其中
问题描述
我在多级子目录下有一个包含 .so 文件、dll 文件、数据文件和 java 类文件的第三方 jar 文件。当我在 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
任何帮助,将不胜感激。谢谢
解决方案
推荐阅读
- algorithm - 跟踪三次插值路径
- firebase - 如何根据flutter中的文档ID从单独列表中的集合中获取文档的每个值
- audio - 结合cdg和mp3时如何使ffmpeg尊重“start_time”变量?
- c# - 如何将数组复制到具有固定数组的结构?
- python - 从 CSV 文件的字段中删除嵌入的换行符
- kubernetes - EKS 内部服务连接不可靠
- javascript - Nock 在使用 Promise.race 时抛出一个不匹配的请求
- python-3.x - 在 Python 中使用 GPU 对字符串打包函数 - 从私钥生成地址
- c# - Zumero Sqlite Sql Server 数据类无效转换
- javascript - 平滑增加数字的数组