百度地图java.lang.unsatisfiedlinkerror怎么解决
答案:1 悬赏:50 手机版
解决时间 2021-03-22 21:14
- 提问者网友:溺爱和你
- 2021-03-22 16:51
百度地图java.lang.unsatisfiedlinkerror怎么解决
最佳答案
- 五星知识达人网友:千杯敬自由
- 2021-03-22 18:29
android Studio不支持在.apk文件打包时,自动加载动态库 .so文件。
解决办法:
既然不支持自动加载,那么就需要我们手动去加载。
在工程项目中 app-->gradle中添加
[java] view plain copy
sourceSets {
main() {
jniLibs.srcDirs = ['libs']
}
}
即可解决。
全部代码展示为:
[java] view plain copy
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.niuduz.baidumap_ding"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main() {
jniLibs.srcDirs = ['libs']
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile files('libs/baidumapapi_base_v4_0_0.jar')
compile files('libs/baidumapapi_cloud_v4_0_0.jar')
compile files('libs/baidumapapi_map_v4_0_0.jar')
compile files('libs/baidumapapi_radar_v4_0_0.jar')
compile files('libs/baidumapapi_search_v4_0_0.jar')
compile files('libs/baidumapapi_util_v4_0_0.jar')
compile files('libs/locSDK_6.13.jar')
}
解决办法:
既然不支持自动加载,那么就需要我们手动去加载。
在工程项目中 app-->gradle中添加
[java] view plain copy
sourceSets {
main() {
jniLibs.srcDirs = ['libs']
}
}
即可解决。
全部代码展示为:
[java] view plain copy
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.niuduz.baidumap_ding"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main() {
jniLibs.srcDirs = ['libs']
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile files('libs/baidumapapi_base_v4_0_0.jar')
compile files('libs/baidumapapi_cloud_v4_0_0.jar')
compile files('libs/baidumapapi_map_v4_0_0.jar')
compile files('libs/baidumapapi_radar_v4_0_0.jar')
compile files('libs/baidumapapi_search_v4_0_0.jar')
compile files('libs/baidumapapi_util_v4_0_0.jar')
compile files('libs/locSDK_6.13.jar')
}
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯