为了账号安全,请及时绑定邮箱和手机立即绑定

无法投射到 com.google.android.gms.location

无法投射到 com.google.android.gms.location

MMTTMM 2021-09-03 21:31:52
当我尝试运行我的应用程序时,应用程序崩溃了,并且在日志 cat 中我看到了这个错误。--------- beginning of crash09-07 22:46:49.571 3479-3479/com.example.www.mytaxiapp E/AndroidRuntime: FATAL EXCEPTION: mainProcess: com.example.www.mytaxiapp, PID: 3479java.lang.ClassCastException: com.example.www.mytaxiapp.Welcome cannot be cast to com.google.android.gms.location.LocationListener    at com.example.www.mytaxiapp.Welcome.startLocationUpdates(Welcome.java:272)    at com.example.www.mytaxiapp.Welcome.onConnected(Welcome.java:308)这是我的进口import android.Manifest;import android.content.pm.PackageManager;import android.location.Location;import android.location.LocationListener;import android.os.Handler;import android.os.SystemClock;import android.support.annotation.NonNull;import android.support.annotation.Nullable;import android.support.design.widget.Snackbar;import android.support.v4.app.ActivityCompat;import android.support.v4.app.FragmentActivity;import android.os.Bundle;import android.util.Log;import android.view.animation.Interpolator;import android.view.animation.LinearInterpolator;import android.widget.Toast;import com.firebase.geofire.GeoFire;import com.firebase.geofire.GeoLocation;import com.github.glomadrian.materialanimatedswitch.MaterialAnimatedSwitch;import com.google.android.gms.common.ConnectionResult;import com.google.android.gms.common.GooglePlayServicesUtil;import com.google.android.gms.common.api.GoogleApiClient;import com.google.android.gms.location.LocationRequest;import com.google.android.gms.location.zzal;import com.google.android.gms.location.LocationServices;import com.google.android.gms.maps.CameraUpdateFactory;import com.google.android.gms.maps.GoogleMap;import com.google.android.gms.maps.OnMapReadyCallback;import com.google.android.gms.maps.SupportMapFragment;
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 223 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信