Android使用百度地图SDK时,发生错误 com.baidu.platform.comjni.map.basemap.JNIBaseMap.Create



01-05 16:13:51.504: E/AndroidRuntime(9886): java.lang.UnsatisfiedLinkError: Native method not found: com.baidu.mapapi.Mj.InitMapControlCC:(II)I
01-05 16:13:51.504: E/AndroidRuntime(9886):  at com.baidu.mapapi.Mj.InitMapControlCC(Native Method)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at com.baidu.mapapi.MapActivity.initMapActivity(Unknown Source)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at com.dobest.smartphone.activitys.LocationActivity.onCreate(LocationActivity.java:55)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.app.Activity.performCreate(Activity.java:5191)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.app.ActivityThread.startActivityNow(ActivityThread.java:1941)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:135)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:347)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:705)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.widget.TabHost.setCurrentTab(TabHost.java:369)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:150)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:560)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.view.View.performClick(View.java:4223)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.view.View$PerformClick.run(View.java:17275)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.os.Handler.handleCallback(Handler.java:615)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.os.Handler.dispatchMessage(Handler.java:92)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.os.Looper.loop(Looper.java:137)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at android.app.ActivityThread.main(ActivityThread.java:4898)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at java.lang.reflect.Method.invokeNative(Native Method)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at java.lang.reflect.Method.invoke(Method.java:511)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
01-05 16:13:51.504: E/AndroidRuntime(9886):  at dalvik.system.NativeStart.main(Native Method)


解决方案:

mBMapMan=new BMapManager(getApplication());
mBMapMan.init(null);


这两行代码对百度地图进行初始化,必须放在setContentView()之前,否则就会出现上面的错误。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值