我的项目用的是 Android Studio 的开发环境
BaiduLBS_Android.jar 与 baidumapapi_v3_4_0.jar 、locSDK_5.3.jar 冲突
两个包同时添加的时候报错:
Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
java.util.zip.ZipException: duplicate entry: com/baidu/mapapi/b.class
我目前添加的包:android_api_1.1_forsdk.jar
BaiduLBS_Android.jar
baidumapapi_v3_4_0.jar
galaxy_mini.jar
locSDK_5.3.jar
请问有什么办法解决吗?
定位和导航都需要,我把 locSDK_5.3.jar 和 baidumapapi_v3_4_0.jar 删掉,编译是不会报那个重复的错误了,但是定位不能用了(初始化直接报错),错误如下:
06-30 21:24:44.486 17579-17579/co.smartac.ulinkwifi E/CrashHandler﹕ error = 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__)
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__)
at com.baidu.platform.comjni.map.commonmemcache.JNICommonMemCache.Create(Native Method)
at com.baidu.platform.comjni.map.commonmemcache.a.a(Unknown Source)
at com.baidu.platform.comapi.d.c.b(Unknown Source)
at com.baidu.mapapi.a.c(Unknown Source)
at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source)
at com.baidu.mapapi.SDKInitializer.initialize(Unknown Source)
at co.smartac.ulinkwifi.map.MapBaiduFragment.onCreateView(MapBaiduFragment.java:102)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1789)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:955)
另外, SDKInitializer.initialize 是在 setContentView 之前调用的没错。