android-fit icon indicating copy to clipboard operation
android-fit copied to clipboard

Error

Open jaag12 opened this issue 9 years ago • 10 comments

Error when trying new versions of Google Fit samples,

E/AndroidRuntime: FATAL EXCEPTION: GoogleApiHandler 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)

have changed the methods and I have noticed that since then my application using the old methods does not record data for DataType TYPE_ACTIVITY_SEGMENT, TYPE_STEP_COUNT_DELTA and sometimes TYPE_HEART_RATE_BPM. What is the solution?

jaag12 avatar Nov 16 '17 09:11 jaag12

@jaag12 hi, which sample did you try?

yoshimaa avatar Nov 28 '17 12:11 yoshimaa

stepCounter and HistoryApiSample both have this error

StephenMPapadatos avatar Nov 30 '17 15:11 StephenMPapadatos

Hi, any update about this error ? it's really annoying

swapps avatar Dec 04 '17 09:12 swapps

@swapps ok, ill make for you, so which one do you wanna?

yoshimaa avatar Dec 04 '17 14:12 yoshimaa

I am getting the same issue with play-services 11.6.0 and the latest session api samples at http://bit.ly/2AFpN8D

ankit209 avatar Dec 07 '17 11:12 ankit209

Hi everyone, I was getting this error too, it seems that we need to configure the demo project to work with our debug-release keystores, so all we need to do is Get an OAuth 2.0 Client ID and run the application again, no changes in code needed, only registering our SHA1 fingerprint.

david99999 avatar Dec 07 '17 14:12 david99999

@jaag12 make the following changes to your gradle.properties, sync and run the app

google_play_services_library=11.8.0
google_support_library=26.1.0

this solved the crash issue I faced with the same log printed in your logcat.

nikhil-tambe avatar Jan 03 '18 11:01 nikhil-tambe

Hey guys need a little help here. I'm not able to remove the listener in the sensorsApi sample. The log cat says "Listener was not removed" . Don't know what to do. Stuck on this problem for a long time now.

lifeLessCoder avatar Jun 22 '18 15:06 lifeLessCoder

check your application id and package name are same. that was my issue now working perfectly

roufalnewage avatar Jun 18 '19 06:06 roufalnewage

I am closing this issue/PR, as it has been migrated to the new repo linked above in the comments. Thank you!

codingjeremy avatar Sep 10 '19 20:09 codingjeremy