Android Studio Project integrated Baidu Map SDK report native method not found: Com.baidu.platform.comjni.map.commonmemcache.JNICommonMemCache.Create: () I error

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.