百度GPS定位开发遇到的一个问题

本文介绍了一种在Android5.0及以上版本中安装百度地图API时出现的java.lang.UnsatisfiedLinkError错误,并提供了一个可行的解决方案。通过调整build.gradle文件中的配置,将JNI库的目录设置为libs,成功解决了该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在做好的百度地图中,运行在Android5.0之前的系统上,显示百度地图没问题,如果安装到Android5.0之上的系统上的时候,安装出错,提示java.lang.UnsatisfiedLinkError: No implementation found for int com.baidu.platform.comjni.map.commonmemcache.JNICommonMemCache.Create() (tried Java_com_baidu_platform_comjni_map_commonmemcache_JNICommonMemCache_Create and Java_com_baidu_platform_comjni_map_commonmemcache_JNICommonMemCache_Create__)等错误,这是什么原因导致的呢?


build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "com.wzc.baidumap"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
[u][i][b] sourceSets {
main() {
jniLibs.srcDirs = ['libs']
}
}[/b][/i][/u]
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile files('libs/baidumapapi_base_v3_7_3.jar')
}

[url]http://blog.youkuaiyun.com/Mr_wzc/article/details/51584443[/url]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值