Details

    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Hyperloop
    • Labels:
      None

      Description

      While trying to access Google Fit History data, the onSuccess is called, but the DataReadResponse methods can't be successfully called to retrieve data.

      Test code:

      Fitness.getHistoryClient(windowActivity, GoogleSignIn.getLastSignedInAccount(windowActivity))
              .readData(new DataReadRequest.Builder()
                  // The data request can specify multiple data types to return, effectively
                  // combining multiple data queries into one call.
                  // In this example, it's very unlikely that the request is for several hundred
                  // datapoints each consisting of a few steps and a timestamp.  The more likely
                  // scenario is wanting to see how many steps were walked per day, for 7 days.
                  .aggregate(DataType.TYPE_STEP_COUNT_DELTA, DataType.AGGREGATE_STEP_COUNT_DELTA)
                  // Analogous to a "Group By" in SQL, defines how data should be aggregated.
                  // bucketByTime allows for a time span, whereas bucketBySession would allow
                  // bucketing by "sessions", which would need to be defined in code.
                  .bucketByTime(1, TimeUnit.DAYS)
                  .setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS)
                  .build())
              .addOnSuccessListener(new OnSuccessListener({
                  onSuccess: function(e) {
                      var dataResponse = new DataReadResponse(e);
       
                      console.log("onSuccess()" + e.toString() + "/" + dataResponse.toString());
                      console.log("buckets size: " + dataResponse.getDataSets().size());
                  }
              }))
              .addOnFailureListener(new OnFailureListener({
                  onFailure: function(e) {
                      console.log("onFailure()");
                  }
              }));
      

      This error is happening
      [INFO] onSuccess()com.google.android.gms.fitness.result.DataReadResponse@645f427/com.google.android.gms.fitness.result.DataReadResponse@95706d4

      [WARN] W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.google.android.gms.fitness.result.DataReadResult.getDataSets()' on a null object reference
      [WARN] W/System.err: at com.google.android.gms.fitness.result.DataReadResponse.getDataSets(Unknown Source:6)
      [WARN] W/System.err: at java.lang.reflect.Method.invoke(Native Method)
      [WARN] W/System.err: at hyperloop.BaseProxy.invokeMethod(BaseProxy.java:157)
      [WARN] W/System.err: at hyperloop.InstanceProxy.invokeMethod(InstanceProxy.java:184)
      [WARN] W/System.err: at hyperloop.BaseProxy.callNativeFunction(BaseProxy.java:129)
      [WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)
      [WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:57)
      [WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:43)
      [WARN] W/System.err: at hyperloop.HyperloopInvocationHandler.invoke(HyperloopInvocationHandler.java:58)
      [WARN] W/System.err: at java.lang.reflect.Proxy.invoke(Proxy.java:913)
      [WARN] W/System.err: at $Proxy0.onSuccess(Unknown Source)
      [WARN] W/System.err: at com.google.android.gms.tasks.zzj.run(Unknown Source:27)
      [WARN] W/System.err: at android.os.Handler.handleCallback(Handler.java:790)
      [WARN] W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
      [WARN] W/System.err: at android.os.Looper.loop(Looper.java:164)
      [WARN] W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6494)
      [WARN] W/System.err: at java.lang.reflect.Method.invoke(Native Method)
      [WARN] W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
      [WARN] W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yankovalera@gmail.com Yanko Valera
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-6183
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Source Code