Integrated Baidu Map SDK in Android Studio Project reported the following error:
1 Java.lang.UnsatisfiedLinkError:Native method Not found: com.baidu.platform.comjni.map.commonmemcache.JNICommonMemCache.Create) I2 At com.baidu.platform.comjni.map.commonmemcache.JNICommonMemCache.Create (Native Method)3 At com.baidu.platform.comjni.map.commonmemcache.a.a (Unknown Source)4 At com.baidu.platform.comapi.c.c.b (Unknown Source)5 At com.baidu.mapapi.a.c (Unknown Source)6 At com.baidu.mapapi.SDKInitializer.initialize (Unknown Source)7 At com.baidu.mapapi.SDKInitializer.initialize (Unknown Source)8............
The problem is that JNI cannot find a way to do this, generally we use eclipse development, put in the Libs/armeabi directory, but the directory of Android Studio is different, with androidstudio words. So file to be placed in src/main/ Jnilibs/armeabi below.
Or make the following changes (recommended):
In the Build.gradle file, add the following code under Android:
1 sourcesets{2 main{3 jnilibs.srcdir ([' Libs '])4 }5 }
The complete configuration file is as follows:
1Apply plugin: ' Com.android.library '2 3 Android {4Compilesdkversion 225Buildtoolsversion "22.0.1"6 7 Defaultconfig {8Minsdkversion 99Targetsdkversion "Android.os.Build.VERSION_CODES. LOLLIPOP_MR1 "TenVersioncode 100 OneVersionname "1.0" A } - - Buildtypes { the Release { -Minifyenabledfalse -Proguardfiles getdefaultproguardfile (' proguard-android.txt '), ' Proguard-rules.pro ' - } + } - //Remove the error from the lint check + lintoptions { AAbortonerrorfalse at } - - packagingoptions { -Exclude ' meta-inf/notice.txt ' -Exclude ' meta-inf/license.txt ' - } in Sourcesets { - Main { toJnilibs.srcdirs = [' Libs '] + } - } the } * $ Dependencies {Panax NotoginsengCompile Filetree (dir: ' Libs ', include: [' *.jar ']) -Compile files (' Libs/android-support-v4.jar ') theCompile files (' Libs/baidulbs_android.jar ') +Compile files (' Libs/zxing.jar ') A}
OK, get it done.
Android Studio Project integrated Baidu Map SDK report native method not found: Com.baidu.platform.comjni.map.commonmemcache.JNICommonMemCache.Create: () I error