Android--百度地图报错:at com.baidu.location.LocationClient.onStart(Unknown Source)

在使用百度地图定位的时候,报一个异常

Exception Ljava/lang/UnsatisfiedLinkError;   
threadid=1: thread exiting with uncaught exception (group=0x410d19d8)  
  
FATAL EXCEPTION: main  
  
java.lang.ExceptionInInitializerError  
at com.baidu.location.g.a(Unknown Source)  
at com.baidu.location.f.int(Unknown Source)  
at com.baidu.location.f.int(Unknown Source)  
at com.baidu.location.f.if(Unknown Source)  
  
at com.baidu.location.f$b.handleMessage(Unknown Source)  
at android.os.Handler.dispatchMessage(Handler.java:99)  
  
at android.os.Looper.loop(Looper.java:137)  
at android.app.ActivityThread.main(ActivityThread.java:4439)  
at java.lang.reflect.Method.invokeNative(Native Method)  
at java.lang.reflect.Method.invo
package xgpushdemo.qt.an.appmap; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import com.baidu.location.BDLocation; import com.baidu.location.BDLocationListener; import com.baidu.location.LocationClient; import com.baidu.location.LocationClientOption; import com.baidu.mapapi.SDKInitializer; import com.baidu.mapapi.map.BaiduMap; import com.baidu.mapapi.map.MapView; import com.baidu.mapapi.map.MyLocationData; /*** * 百度定位、导航 * */ public class MainActivity extends Activity { private Button clickbtn; private TextView txt1; private TextView txt2; private MapView mMapView = null; private BaiduMap mBaiduMap=null; //定位相关申明 private LocationClient locationClient; //是否第一次定位 private Boolean isFirstloc=true; //是否开启 private Boolean isStart=true; private String la; private String lo; private String city; public BDLocationListener myListener=new BDLocationListener() { @Override public void onReceiveLocation(BDLocation bdLocation) { if(bdLocation==null||mMapView==null) return; MyLocationData myLocationData= new MyLocationData.Builder().accuracy(bdLocation.getRadius()).direction(100). latitude(bdLocation.getLatitude()).longitude(bdLocation.getLongitude()).build(); mBaiduMap.setMyLocationData(myLocationData); city= bdLocation.getCity(); la=bdLocation.getLatitude()+""; lo=bdLocation.getLongitude()+""; // if(isFirstloc){ // isFirstloc=false; // LatLng ll=new LatLng(bdLocation.getLatitude(),bdLocation.getLongitude()); // MapStatusUpdate mapStatusUpdate= MapStatusUpdateFactory.newLatLngZoom(ll,16); // mBaiduMap.animateMapStatus(mapStatusUpdate); // } } };
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值