测试新版Google Fit Samples,
时出错Process: com.google.android.gms.fit.samples.basicrecordingapi, PID: 22949
java.lang.NullPointerException: Attempt to invoke virtual method 'android.accounts.Account com.google.android.gms.auth.api.signin.GoogleSignInAccount.getAccount()' on a null object reference
at com.google.android.gms.common.api.GoogleApi.zzagd(Unknown Source)
at com.google.android.gms.common.api.GoogleApi.zza(Unknown Source)
at com.google.android.gms.common.api.internal.zzbr.<init>(Unknown Source)
at com.google.android.gms.common.api.internal.zzbp.zzb(Unknown Source)
at com.google.android.gms.common.api.internal.zzbp.handleMessage(Unknown Source)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:158)
at android.os.HandlerThread.run(HandlerThread.java:61)
方法已经改变,我注意到从那时起,我使用旧方法的应用程序没有为DataTypes TYPE_ACTIVITY_SEGMENT,TYPE_STEP_COUNT_DELTA以及有时TYPE_HEART_RATE_BPM注册数据。解决方案是什么?