Closed ColtonIdle closed 5 years ago
If you are calling Marketo's 'onStop()/onActivityStopped' method in your application. Then you can remove these methods now as it won't required in SDK version 0.8.0, and we have already updated it on our developer document (https://developers.marketo.com/mobile/installation/#android_sdk_installation).
We're not calling onStop()
anywhere. We use Marketo for a very limited use case in our app.
We call Marketo.reportAction(event, meta);
often and we call Marketo.getInstance(requireContext()).associateLead(lead)
once.
Bump
We are looking into the issue. @ColtonIdle If possible, can you please share the application with us, it will help us to debug better.
Thanks for confirming that you're looking into it. I can't share the application details, but I can share some other details such as the device.
batteryLevel 0.62 brand samsung charging false cpuAbi [ "arm64-v8a", "armeabi-v7a", "armeabi" ] dpi 480 emulator false freeDisk 57205981184 freeMemory 264105032 id 11208de3-9863-44c4-9a8e-5fe1f51ccb0a jailbroken false locale en_US locationStatus allowed manufacturer samsung model SM-G950U networkAccess wifi orientation portrait osName android osVersion 8.0.0 runtimeVersions { "androidApiLevel": "26", "osBuild": "R16NW.G950USQS5CSB1" } screenDensity 3 screenResolution 2076x1080 time 2019-05-07T02:10:54.000Z totalMemory 268435456
Ok @ColtonIdle Thank you for providing the information. I will debug based on this and get back to you once it is fixed.
The original report was from Bugsnag, but there's a similar one from the Play console.
Samsung Galaxy S8 (dreamqltesq), Android 8.0
"main" tid=1 Blocked
"main" prio=5 tid=1 Blocked
| group="main" sCount=1 dsCount=0 flags=1 obj=0x733ea100 self=0x7b526c4a00
| sysTid=30225 nice=-10 cgrp=default sched=0/0 handle=0x7b57af29c8
| state=S schedstat=( 944699744 235098167 2882 ) utm=63 stm=31 core=0 HZ=100
| stack=0x7fbff67000-0x7fbff69000 stackSize=8MB
| held mutexes=
at com.marketo.Marketo.b (SourceFile:20822)
- waiting to lock <0x02f81912> (a com.marketo.Marketo) held by thread 29
at com.marketo.Marketo$a.onActivityStopped (SourceFile:947)
at android.app.Application.dispatchActivityStopped (Application.java:258)
at android.app.Activity.onStop (Activity.java:1921)
at androidx.fragment.app.FragmentActivity.onStop (FragmentActivity.java:541)
at androidx.appcompat.app.AppCompatActivity.onStop (AppCompatActivity.java:185)
at com.myapp.Base.onStop (Base.java:95)
Please try putting delay (100/200ms) while calling "reportAction()" & "associateLead()" method, so it must call after initialization of SDK. If it fix your issue then we will update the SDK in next release.
Are you saying that associateLead()
and reportAction()
must be called synchronously?
Or are you saying that associateLead()
HAS to complete before any reportAction()
can be called?
Or is it something else?
I'm just trying to understand what the problem is before I introduce an artificial delay on the main thread of my application.
No, I am saying that initializeSDK(munchkinId,appSecretKey)
method should be called before associateLead ()
& reportAction()
.
Okay.
In my case, I'm already calling initializeSDK(munchkinId,appSecretKey)
before associateLead()
& reportAction()
.
You want me to add an artificial delay after initializeSDK(munchkinId,appSecretKey)
? If so, I'm not sure if that will be approved on my team as initializeSDK(munchkinId,appSecretKey)
is called in our App.onCreate() so adding a delay there will delay the main thread.
You can try putting associateLead
() & reportAction()
methods in runnable to avoid ANR.
Handler mHandler = new Handler();
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
Marketo.reportAction(reportAction,meta);
}
},100);
Ran this by my team and we decided that we don't want to go this route as it's pretty hacky. We hope that you agree.
Can the Marketo team fix this so that the SDK doesn't cause ANRs?
Sure.
As here we are not able to reproduce it, So just want to confirm with you that you see this ANR in production and play console & Bugsnag tools are showing this report?
Are you also able to reproduce ANR in debug build on your system?
Yes. We got the crash in two places. BugSnag and Play Console.
We just added Marketo 0.8.0 so I don't know if earlier versions had this problem.
Is your application is free on play store? If yes, then can you please share me the play store url of the application. So i can download the app and check if something i can debug.
Can't release that information. Sorry
Please reach out to this support channel for the help. https://www.marketo.com/why-marketo/services-and-support/support/
I'm using the latest Marketo SDK 0.8.0 and I'm getting reports of ANRs in production. Please investigate and fix as soon as you can. Please and thank you!
Stacktrace:
Threads: