android / fit-samples

Multiple samples showing the best practices using the Fit APIs on Android.
Apache License 2.0
151 stars 113 forks source link

Error #10

Open codingjeremy opened 5 years ago

codingjeremy commented 5 years ago

Issue by jaag12 Thursday Nov 16, 2017 at 09:09 GMT Originally opened as https://github.com/googlesamples/android-fit/issues/28


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?

codingjeremy commented 5 years ago

Comment by yoshimaa Tuesday Nov 28, 2017 at 12:48 GMT


@jaag12 hi, which sample did you try?

codingjeremy commented 5 years ago

Comment by StephenMPapadatos Thursday Nov 30, 2017 at 15:32 GMT


stepCounter and HistoryApiSample both have this error

codingjeremy commented 5 years ago

Comment by swapps Monday Dec 04, 2017 at 09:12 GMT


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

codingjeremy commented 5 years ago

Comment by yoshimaa Monday Dec 04, 2017 at 14:08 GMT


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

codingjeremy commented 5 years ago

Comment by ankit209 Thursday Dec 07, 2017 at 11:39 GMT


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

codingjeremy commented 5 years ago

Comment by david99999 Thursday Dec 07, 2017 at 14:20 GMT


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.

codingjeremy commented 5 years ago

Comment by nikhil-tambe Wednesday Jan 03, 2018 at 11:33 GMT


@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.

codingjeremy commented 5 years ago

Comment by lifeLessCoder Friday Jun 22, 2018 at 15:16 GMT


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.

codingjeremy commented 5 years ago

Comment by roufalnewage Tuesday Jun 18, 2019 at 06:58 GMT


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