Tenjin plugin crashing at start of the app

Hi, I’m trying to use tenjin plugin but my app crashes at the start on Android. Here is the error I can read in my console:

05-11 22:07:07.861  8868  8868 E AndroidRuntime: FATAL EXCEPTION: main

05-11 22:07:07.861  8868  8868 E AndroidRuntime: Process: com.gmail.ciaudo.david.dragonmarathon, PID: 8868

05-11 22:07:07.861  8868  8868 E AndroidRuntime: java.lang.NoClassDefFoundError: com.tenjin.android.TenjinSDK$3

05-11 22:07:07.861  8868  8868 E AndroidRuntime:        at com.tenjin.android.TenjinSDK.<init>(TenjinSDK.java:1313)

05-11 22:07:07.861  8868  8868 E AndroidRuntime:        at com.tenjin.android.TenjinSDK.getInstance(TenjinSDK.java:123)

05-11 22:07:07.861  8868  8868 E AndroidRuntime:        at plugin.tenjin.LuaLoader$Init$1.run(LuaLoader.java:417)

05-11 22:07:07.861  8868  8868 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:739)

05-11 22:07:07.861  8868  8868 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)

05-11 22:07:07.861  8868  8868 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:158)

05-11 22:07:07.861  8868  8868 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7224)

05-11 22:07:07.861  8868  8868 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)

05-11 22:07:07.861  8868  8868 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

05-11 22:07:07.861  8868  8868 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

My app is very basic sample with the require plugin and init function.

I’ll ping our Engineering team.

Rob

Also I noticed, if I just require the plugin, and not call the init function, the app crashes when I suspend and resume it on my samsung galaxy S7. Here is the crash report:

05-12 01:23:30.745  4821  4821 E AndroidRuntime: FATAL EXCEPTION: main

05-12 01:23:30.745  4821  4821 E AndroidRuntime: Process: com.gmail.honeyponeygames.squarekittenjump, PID: 4821

05-12 01:23:30.745  4821  4821 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method ‘void com.tenjin.android.TenjinSDK.connect()’ on a null object reference

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at plugin.tenjin.LuaLoader$1.run(LuaLoader.java:186)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:739)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:158)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7224)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

I hope this gonna be fixed, I really need this plugin.

Fix for that issue should be included in the next plugin update, which is in the work and will be released asap. Stay tuned!

Hi david.ciaudo,

Can you check it on your machine? There was an update with init code refactoring on Tenjin SDK side, so your issue should be fixed. If not, then you’ll need to prepare a sample to reproduce an issue and send it to us @ https://portal.coronalabs.com/bug-submission. We’ll check it and tell you what should be fixed.

I’ll check it out as soon as I’m back from my vacations. By the way, the sample which was crashing is a simple blank project with require tengin and a build setting with the plugin included.

We can’t reproduce an issue on our samples. That’s why I ask you to send yours, there may be some build settings issue or something.

Hello, I’ve tried with the latest daily build and the problem is still there:

-crash on init function

-crash on resume (if init is commented and there is the require line)

I’ve submitted an apk to the debug portal but, as I said, it’s a simple blank project, with this piece of code:

local tenjin = require "plugin.tenjin" local TENJIN\_KEY = "TVJCWXABBTLUSV45END9WT\*\*\*\*\*\*\*\*" local tenjinListener = function(e) print("tenjin listener") for u,v in pairs(e) do print(u,v) end end tenjin.init(tenjinListener, {apiKey = TENJIN\_KEY})

and the plugin included in the build.settings:

plugins = { ["plugin.tenjin"] = { publisherId = "com.coronalabs" }, },

I did not submitted a crash log file, I don’t know where I can find this when testing on device.

Thanks for the feedback!

Seems that this new sdk update haven’t solved the issue. We’ll investigate it more with Tenjin team asap  B)

To everyone lurking:

Thanks to David, his help and patience, both issues was solved and fix is already public.

Thx it’s working! No more crash.

Also, I just had to put hasUserConsent = true in the init because when it’s false, I don’t receive any event.

I’ll ping our Engineering team.

Rob

Also I noticed, if I just require the plugin, and not call the init function, the app crashes when I suspend and resume it on my samsung galaxy S7. Here is the crash report:

05-12 01:23:30.745  4821  4821 E AndroidRuntime: FATAL EXCEPTION: main

05-12 01:23:30.745  4821  4821 E AndroidRuntime: Process: com.gmail.honeyponeygames.squarekittenjump, PID: 4821

05-12 01:23:30.745  4821  4821 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method ‘void com.tenjin.android.TenjinSDK.connect()’ on a null object reference

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at plugin.tenjin.LuaLoader$1.run(LuaLoader.java:186)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:739)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:158)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7224)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)

05-12 01:23:30.745  4821  4821 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

I hope this gonna be fixed, I really need this plugin.

Fix for that issue should be included in the next plugin update, which is in the work and will be released asap. Stay tuned!

Hi david.ciaudo,

Can you check it on your machine? There was an update with init code refactoring on Tenjin SDK side, so your issue should be fixed. If not, then you’ll need to prepare a sample to reproduce an issue and send it to us @ https://portal.coronalabs.com/bug-submission. We’ll check it and tell you what should be fixed.

I’ll check it out as soon as I’m back from my vacations. By the way, the sample which was crashing is a simple blank project with require tengin and a build setting with the plugin included.

We can’t reproduce an issue on our samples. That’s why I ask you to send yours, there may be some build settings issue or something.

Hello, I’ve tried with the latest daily build and the problem is still there:

-crash on init function

-crash on resume (if init is commented and there is the require line)

I’ve submitted an apk to the debug portal but, as I said, it’s a simple blank project, with this piece of code:

local tenjin = require "plugin.tenjin" local TENJIN\_KEY = "TVJCWXABBTLUSV45END9WT\*\*\*\*\*\*\*\*" local tenjinListener = function(e) print("tenjin listener") for u,v in pairs(e) do print(u,v) end end tenjin.init(tenjinListener, {apiKey = TENJIN\_KEY})

and the plugin included in the build.settings:

plugins = { ["plugin.tenjin"] = { publisherId = "com.coronalabs" }, },

I did not submitted a crash log file, I don’t know where I can find this when testing on device.

Thanks for the feedback!

Seems that this new sdk update haven’t solved the issue. We’ll investigate it more with Tenjin team asap  B)

To everyone lurking:

Thanks to David, his help and patience, both issues was solved and fix is already public.