Search code examples
androidtrigger.ioflurry

NumberFormatException when using forge.flurry.setLocation


I'm trying to implement Flurry Analytics in my trigger.io app. When executing the example for setLocation on an Android device:

forge.geolocation.getCurrentPosition(function (position) {
    forge.flurry.setLocation(position.coords);
});

I get the following error:

Error while executing API method: flurry.setLocation  

message: "Forge Java error: NumberFormatException: Invalid BigInteger: 45.5150396"  
type: "UNEXPECTED_FAILURE"  
full_error:
java.lang.NumberFormatException: Invalid BigInteger: 45.5150396
  at java.math.BigInt.invalidBigInteger(BigInt.java:124)
  at java.math.BigInt.checkString(BigInt.java:180)
  at java.math.BigInt.putDecString(BigInt.java:128)
  at java.math.BigInteger.<init>(BigInteger.java:183)
  at com.google.gson.internal.LazilyParsedNumber.longValue(LazilyParsedNumber.java:51)
  at com.google.gson.JsonPrimitive.getAsLong(JsonPrimitive.java:233)
  at io.trigger.forge.android.modules.flurry.API.setLocation(API.java:65)
  at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511)
  at io.trigger.forge.android.core.ForgeApp.callJavaFromJavaScript(ForgeApp.java:315)
  at io.trigger.forge.android.core.ForgeJSBridge$1.run(ForgeJSBridge.java:25)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
  at java.lang.Thread.run(Thread.java:856)

I seem to be able to get around this problem by rounding the latitude and longitude of position.coords, but I will be sacrificing a bit of accuracy.

Am I doing something wrong here or is this a bug that can be fixed in a future release?


Solution

  • This looks like a bug in our Flurry integration code: they're expecting a float, sure enough, so we're just pulling data out of your parameters incorrectly.

    We'll have a fix in our next platform version.