调用时,我收到IllegalArgumentException:
Location locationTemp = LocationServices.FusedLocationApi.getLastLocation(
mGoogleApiClient);
使用ff stacktrace:
java.lang.IllegalArgumentException
com.google.android.gms.common.internal.zzx.zzb(Unknown Source)
com.google.android.gms.location.LocationServices.zze(Unknown Source)
com.google.android.gms.location.internal.zzd.getLastLocation(Unknown Source)
....location.LocationHelper.getLastKnownLocation(LocationHelper.java:137)
............
android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1056)
android.animation.ValueAnimator.access$400(ValueAnimator.java:50)
android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:644)
android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:660)
android.view.Choreographer$CallbackRecord.run(Choreographer.java:807)
android.view.Choreographer.doCallbacks(Choreographer.java:601)
android.view.Choreographer.doFrame(Choreographer.java:561)
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:791)
android.os.Handler.handleCallback(Handler.java:733)
android.os.Handler.dispatchMessage(Handler.java:95)
android.os.Looper.loop(Looper.java:157)
android.app.ActivityThread.main(ActivityThread.java:5633)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:515)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:896)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:712)
dalvik.system.NativeStart.main(Native Method)
我使用LocationsServices.API和Places.GEO_DATA_API初始化了Google Api客户端。