Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Crash on flurry.startSession(api_key) using Android Studio — Gideros Forum

Crash on flurry.startSession(api_key) using Android Studio

unlyingunlying Guru
edited February 2017 in General questions
I'm pretty beginner with Android Studio(and Flurry) so, i'm sure that i'm doing something wrong.
May be somebody can help me with that?

If i have just require "flurry" - app doesn't crash.
But if i have
local api_key = "somekey"
if flurry ~= nil and flurry.isAvailable() then
print("Flurry is available")
flurry.startSession(api_key)
-- flurry.logEvent("test_event",{name="test"})
else
print("Flurry is not available")
end
- it crashes with such anr:

02-12 18:05:34.370 30973-31008/com.debia.trueorfalse E/dalvikvm: VM aborting
02-12 18:05:34.370 30973-31008/com.debia.trueorfalse A/libc: Fatal signal 6 (SIGABRT) at 0x000078fd (code=-6), thread 31008 (Thread-33129)

What i have done:
System.loadLibrary("flurry"); added to Activity.java
"com.giderosmobile.android.Flurry", added to Activity.java
compile 'com.flurry.android:analytics:6.2.0' added to dependencies in gradle

Comments

  • 02-13 01:34:02.095: D/Gideros(18366): Flurry is available
    02-13 01:34:02.095: W/dalvikvm(18366): Invalid indirect reference 0x418b11a0 in decodeIndirectRef
    02-13 01:34:02.095: I/dalvikvm(18366): "GLThread 35241" prio=5 tid=12 RUNNABLE
    02-13 01:34:02.095: I/dalvikvm(18366): | group="main" sCount=0 dsCount=0 obj=0x428e7560 self=0x7255d4d8
    02-13 01:34:02.095: I/dalvikvm(18366): | sysTid=18380 nice=0 sched=0/0 cgrp=apps handle=1918228784
    02-13 01:34:02.095: I/dalvikvm(18366): | state=R schedstat=( 86538627 24481209 158 ) utm=2 stm=6 core=2
    02-13 01:34:02.095: I/dalvikvm(18366): at com.giderosmobile.android.player.GiderosApplication.nativeDrawFrame(Native Method)
    02-13 01:34:02.095: I/dalvikvm(18366): at com.giderosmobile.android.player.GiderosApplication.onDrawFrame(GiderosApplication.java:669)
    02-13 01:34:02.095: I/dalvikvm(18366): at com.giderosmobile.android.GiderosRenderer.onDrawFrame(trueorfalseActivity.java:361)
    02-13 01:34:02.095: I/dalvikvm(18366): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1531)
    02-13 01:34:02.095: I/dalvikvm(18366): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)
    02-13 01:34:02.095: E/dalvikvm(18366): VM aborting
    02-13 01:34:02.095: A/libc(18366): Fatal signal 6 (SIGABRT) at 0x000047be (code=-6), thread 18380 (Thread-35241)
    02-13 01:34:02.125: I/dalvikvm(18366): Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.zze.zzm
  • Here's my analytics class
    Analytics = Core.class()
     
    function Analytics:init()
     
      self.analyticsEnabled = app.gameConfig.analyticsEnabled
      self.isFlurryAvailable = false
     
      if self.analyticsEnabled then
     
        --print("before flurry require")
        if pcall(require, "flurry") then
          print "============================="
          print "== require flurry: SUCCESS =="
          print "============================="
          require "flurry"
          self.isFlurryStarted = false
          if flurry.isAvailable() then
            local flurryTable = app.gameConfig.flurryKey[app.platform]
            self.flurryKey = flurryTable[app.user.appType]          
            print "------Flurry available: start analytics"
            print("Flurry: ".. app.platform.. " " ..app.user.appType.." "..self.flurryKey)
            --print("KEY:    "..flurryKey)
            print "======================================="
            flurry.startSession(self.flurryKey)
            self.isFlurryAvailable = true
          else
            print "flurry not available"      
          end
        else
          print "require flurry: FAILED"
        end
      end
    end
    function Analytics:logEvent( options )
     
      if not self.isFlurryAvailable or not self.analyticsEnabled then return true end
     
      local name   = options.name 
      local params = options.params
      print ("=============================================================================")
      print ("== LOG EVENT: "..name)
      print ("== KEY:       "..self.flurryKey)
      print ("== APP TYPE:  "..app.user.appType)  
      print ("=============================================================================")
      flurry.logEvent( name, params, false )
    end
    function Analytics:logTimedEvent(options)
     
      if not self.isFlurryAvailable or not self.analyticsEnabled then return true end
     
      local name = options.name 
      local params = options.params
      print "log timed event"
      flurry.logEvent( name, params, true )
    end
    function Analytics:endTimedEvent(options)
     
      if not self.isFlurryAvailable or not self.analyticsEnabled then return true end
     
      local name = options.name 
      local params = options.params
      print "end timed event"
      flurry.endTimedEvent( name, params )
    end
    function Analytics:destroy()
      self = nil
    end
  • SinisterSoftSinisterSoft Maintainer
    edited February 2017
    Flurry works fine for me - but moving over to firebase now anyhow.

    Set flurryId to the id flurry give you for the game/platform.

    Make a player and tick the flurry plugin on export. You need the latest version of Gideros to have the latest working libs. I think the 2017.2 version will be out today.
    function message(mess,param)
    	if flurry and flurry.isAvailable() then
    		if param==nil then
    			flurry.logEvent(mess)
    		else
    			flurry.logEvent(mess,param)
    		end
    	end
    end
     
    if flurryId then
    	pcall(function() require "flurry" end)
    	if flurry and flurry.isAvailable() then
    		flurry.startSession(flurryId)
    	end
    end
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
Sign In or Register to comment.