AppLovin is crashing - in AdLoadListener.adReceived..

Applovin is crashing very frequently especially when. I have tested this with latest release build as well as 2864.

Any clues ?

04-14 18:47:12.861 I/ActivityManager(  912): Activity reported stop, but no longer stopping: ActivityRecord{b777239 u0 com.sec.android.app.launcher/com.android.launcher2.Launcher t2409}

04-14 18:47:12.961 D/ActivityManager(  912): post active user change for 0

04-14 18:47:12.981 W/System.err(15544): java.lang.NullPointerException: Attempt to invoke interface method ‘boolean java.util.Map.containsKey(java.lang.Object)’ on a null object reference

04-14 18:47:12.981 W/System.err(15544): at plugin.applovin.LuaLoader$AdLoadListener.adReceived(LuaLoader.java:353)

04-14 18:47:12.981 W/System.err(15544): at com.applovin.impl.sdk.ac.run(Unknown Source)

04-14 18:47:12.981 W/System.err(15544): at android.os.Handler.handleCallback(Handler.java:739)

04-14 18:47:12.981 W/System.err(15544): at android.os.Handler.dispatchMessage(Handler.java:95)

04-14 18:47:12.981 W/System.err(15544): at android.os.Looper.loop(Looper.java:145)

04-14 18:47:12.981 W/System.err(15544): at android.app.ActivityThread.main(ActivityThread.java:5944)

04-14 18:47:12.981 W/System.err(15544): at java.lang.reflect.Method.invoke(Native Method)

04-14 18:47:12.981 W/System.err(15544): at java.lang.reflect.Method.invoke(Method.java:372)

04-14 18:47:12.981 W/System.err(15544): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)

04-14 18:47:12.981 W/System.err(15544): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

04-14 18:47:12.991 E/ActivityManager(  912): checkUser: useridlist=null, currentuser=0

04-14 18:47:12.991 E/ActivityManager(  912): checkUser: useridlist=null, currentuser=0

04-14 18:47:12.991 E/ActivityManager(  912): checkUser: useridlist=null, currentuser=0

04-14 18:47:12.991 E/ActivityManager(  912): checkUser: useridlist=null, currentuser=0

04-14 18:47:13.021 I/ActivityManager(  912): Start proc com.sec.android.widgetapp.digitalclock for broadcast com.sec.android.widgetapp.digitalclock/.DigitalClockWidgetProvider: pid=16213 uid=10043 gids={50043, 9997} abi=armeabi-v7a

04-14 18:47:13.041 W/ActivityManager(  912):   Force finishing activity com.xxx.yyy/com.ansca.corona.CoronaActivity

Can you provide more context?

Can you show us your code around initing the plugin, it’s listener and so on?

I am displaying approving when the app loads (clean startup & resume - non-incentive ), and also using it as rewarded ads to get coins etc.

My observations are:

  1. sometimes I saw approvin ads playing without any issues - both at startup(non-incentive) & rewarded ads.

  2. sometimes rewarded ads show complete blank screen and app eventually crashes ( unresponsive )

  3. sometimes app crashes during startup time ( the crash dump I have attached in my first message )

Below is the my code :

local applovin = require( "plugin.applovin" ) local function loadApplovinVideoAd( isIncentivized ) applovin.load( isIncentivized ) end local function AppLovinAdListener( event ) -- Successful initialization of the AppLovin plugin if ( event.phase == "init" ) then myDbgPrint(DBG\_LVL, "AppLovinAdListener - event: initialization successful" ) myDbgPrint(DBG\_LVL, "AppLovinAdListener - event.error: ", event.isError ) loadApplovinVideoAd( true ) -- incentivized loadApplovinVideoAd( false) -- NOT-incentivized -- An ad loaded successfully elseif ( event.phase == "loaded" ) then myDbgPrint(DBG\_LVL, "AppLovinAdListener - event: " .. tostring(event.type) .. " ad loaded successfully" ) -- The ad was displayed/played elseif ( event.phase == "displayed" or event.phase == "playbackBegan" ) then myDbgPrint(DBG\_LVL, "AppLovinAdListener - event: " .. tostring(event.type) .. " ad displayed" ) -- The ad was closed/hidden elseif ( event.phase == "hidden" or event.phase == "playbackEnded" ) then myDbgPrint(DBG\_LVL, "AppLovinAdListener - event: " .. tostring(event.type) .. " ad closed/hidden" ) -- The user clicked/tapped an ad elseif ( event.phase == "clicked" ) then myDbgPrint(DBG\_LVL, "AppLovinAdListener - event: " .. tostring(event.type) .. " ad clicked/tapped" ) -- The ad failed to load elseif ( event.phase == "failed" ) then myDbgPrint(DBG\_LVL, "AppLovinAdListener - event: " .. tostring(event.type) .. " ad failed to load" ) -- The user declined to view a rewarded/incentivized video ad elseif ( event.phase == "declinedToView" ) then myDbgPrint(DBG\_LVL, "AppLovinAdListener - event: user declined to view " .. tostring(event.type) .. " ad" ) -- The user viewed a rewarded/incentivized video ad elseif ( event.phase == "validationSucceeded" ) then myDbgPrint(DBG\_LVL, "AppLovinAdListener - event: " .. tostring(event.type) .. " ad viewed and reward approved by AppLovin server" ) -- local alert = native.showAlert( "Note", "AppLovin reward of " .. tostring(event.data.amount) .. " " .. tostring(event.data.currency) .. " registered!", { "OK" } ) -- The incentivized/rewarded video ad and/or reward exceeded quota, failed, or was rejected elseif ( event.phase == "validationExceededQuota" or event.phase == "validationFailed" or event.phase == "validationRejected" ) then myDbgPrint(DBG\_LVL, "AppLovinAdListener - event: " .. tostring(event.type) .. " ad and/or reward exceeded quota, failed, or was rejected" ) end end local function applovin\_ads\_available( isIncentivized ) return applovin.isLoaded( isIncentivized ) end local function displayVideoAd\_Applovin( isIncentivized ) local ret = false if ( applovin\_ads\_available( isIncentivized ) == true ) then ret = true applovin.show( isIncentivized ) end loadApplovinVideoAd( true ) loadApplovinVideoAd( false ) return ret end local function initApplovinAds() applovin.init( AppLovinAdListener, { sdkKey=\_ACCOUNTS.ADS.APPLOVIN.KEY, verboseLogging=true } ) end -------------------------- below is how I call it local function displayVideoAd( isIncentivized )    local ret = applovin\_ads\_available( isIncentivized )

   if ( ret == true ) then

       analyticsLogEvent(“Ads_shown_applovin”)

       analyticsLogEvent(“Ads_shown_total”)

                

       if ( isIncentivized == true ) then – for incentivized ads

           myDbgPrint(2, "  Displaying AppLovin video ad")

           timer.performWithDelay(10, FF_Ads_reward_free_feathers, 1)

           analyticsLogEvent(“Ads_shown_incentivized_applovin”)

           analyticsLogEvent(“Ads_shown_incentivized”)

       else

           analyticsLogEvent(“Ads_shown_nonIncentivized_applovin”)

           analyticsLogEvent(“Ads_shown_nonIncentivized”)

       end

                

       displayVideoAd_Applovin( isIncentivized )

                

   else

       myDbgPrint(2, "  FAILED to display AppLovin video ad")

       analyticsLogEvent(“Ads_failed_applovin”)

       analyticsLogEvent(“Ads_failed_total”)

   end

end

displayVideoAd( true | false )

Let me know if you need anything else.

and the below ‘ads logcat’ logs are from an instance where I played an applovin incentivized ad and the app froze.

I got a black screen (my game music was still playing during that time), app got unresponsive, and was killed; i.e. got a popup saying “app is not responding… do you want to close it”

04-14 20:35:13.326 I/Corona (30707): Displaying AppLovin video ad 04-14 20:35:13.326 W/FlurryAgent(30707): Event count started: Ads\_shown\_incentivized\_applovin 04-14 20:35:13.326 I/Corona (30707): ==================================================== yyy-flurry event name: Ads\_shown\_incentivized\_applovin 04-14 20:35:13.326 W/FlurryAgent(30707): Event count started: Ads\_shown\_incentivized 04-14 20:35:13.326 I/Corona (30707): ==================================================== yyy-flurry event name: Ads\_shown\_incentivized 04-14 20:35:13.326 D/AppLovinSdk(30707): [FileManager] Looking up cached resource: 1437176024\_x.mp4 04-14 20:35:13.346 W/ContextImpl(30707): Failed to ensure directory: /storage/extSdCard/Android/data/com.xxx.yyy/files 04-14 20:35:13.346 D/AppLovinSdk(30707): [FileManager] Looking up cached resource: 1437176024\_x.mp4 04-14 20:35:13.346 W/ContextImpl(30707): Failed to ensure directory: /storage/extSdCard/Android/data/com.xxx.yyy/files 04-14 20:35:13.346 I/Timeline(30707): Timeline: Activity\_launch\_request id:com.xxx.yyy time:214612478 04-14 20:35:13.346 E/PersonaManagerService( 912): inState(): stateMachine is null !! 04-14 20:35:13.356 I/PersonaManagerService( 912): Failed to execute isKioskModeEnabled. java.lang.SecurityException: You need MANAGE\_USERS permission to: query user 04-14 20:35:13.356 I/ActivityManager( 912): do not start freezing screen for locked container getKeyguardshowstate = false 04-14 20:35:13.356 D/ResourcesManager( 912): creating new AssetManager and set to /data/app/com.xxx.yyy-1/base.apk 04-14 20:35:13.386 D/AppLovinSdk(30707): [TaskValidateReward] Scheduling TaskValidateReward on BACKGROUND queue in 0ms. 04-14 20:35:13.386 I/AppLovinSdk(30707): [TaskValidateReward] Task started execution... 04-14 20:35:13.386 I/AppLovinSdk(30707): [ConnectionManager] Sending POST request to "https://d.applovin.com/vr?device\_token=MaznYs97JTiqaqEwnZGZ5pdoZbbbLMFg3n9BXTxUgWGkXJrEJ7hX37t1efOPhfAtfxi8KWUQAhUFGIB-UtGl4oBD9G5gSDETx7F4dJ-jTZYSfgVOgavW6rPRlSfA3K6B8sGgh\_otPUIKnvMKHvGcY-dMZbCyzuUzOn6Gn3kjnFY="... 04-14 20:35:13.386 D/AppLovinSdk(30707): [ConnectionManager] Request to "https://d.applovin.com/vr?device\_token=MaznYs97JTiqaqEwnZGZ5pdoZbbbLMFg3n9BXTxUgWGkXJrEJ7hX37t1efOPhfAtfxi8KWUQAhUFGIB-UtGl4oBD9G5gSDETx7F4dJ-jTZYSfgVOgavW6rPRlSfA3K6B8sGgh\_otPUIKnvMKHvGcY-dMZbCyzuUzOn6Gn3kjnFY=" is {"clcode":"3!52608.1460680230!kX6vP\_IaKtEe8mHwuTUD97PPhku73vEN2NVfY0baB4azO1ImSHReKkpsjPBtrkxvKayOA2-soMQ\_pqr1wbVlmn-FHyVQJg9Y820RDQVnBk2lfVO-CUYYn8CGZu2qXHZqq6\_eNQakl3okanRZNxmyaiwNQ\_AwUaPv3ouszyL4D5y2f2Ba\_kMX3bWLfISsbkfBi1aX4ioRUAeGgvaBbFY-ak6m4CAMe6bitpgtZnsztEKyn3PjWAV96XDR4D41fl2qWrSyBFV4b6HlZVKNw4pNT2wRU7JqPQTW14FyOnPmrOJUruWtZVNFJmQHZsm96dgtFwExXPW6jI-0n69JWcnSjJEceiHf7WUfCt1S21UcFAaRF84CbNefNpsWw7xVenlJB0NRkgO8jgM7EAZv87UJlBxihosID1c\_TyAgVGguHeozBEo-34zfhSzNCvh-bdt2fcwCZHioP\_3RfSRL2OzHh9CSk5t2xLCzeh\_B6HCH-ZWfVArZyea5YvEtY9jDBEZIIelwIc1oCugrQAoOZgorug58q9szMFDwJTQv7Ydyg64\*"} 04-14 20:35:13.386 I/System.out(30707): (HTTPLog)-Static: isSBSettingEnabled false 04-14 20:35:13.396 E/GooglePlayServicesUtil(30707): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included. 04-14 20:35:13.416 I/System.out(30707): KnoxVpnUidStorageknoxVpnSupported API value returned is false 04-14 20:36:20.406 I/InputDispatcher( 912): Delivering touch to (30707): action: 0x0, toolType: 1 04-14 20:36:20.476 I/InputDispatcher( 912): Delivering touch to (30707): action: 0x1, toolType: 1 04-14 20:36:41.386 I/InputDispatcher( 912): Application is not responding. It has been 20005.3ms since event, 20001.6ms since wait started. Reason: Waiting to send key event because the focused window has not finished processing all of the input events that were previously delivered to it. Outbound queue length: 0. Wait queue length: 15. 04-14 20:36:41.386 I/WindowManager( 912): Input event dispatching timed out sending to com.xxx.yyy/com.ansca.corona.CoronaActivity. Reason: Waiting to send key event because the focused window has not finished processing all of the input events that were previously delivered to it. Outbound queue length: 0. Wait queue length: 15. 04-14 20:36:41.416 D/InputDispatcher( 912): Waiting for application to become ready for input: xxxx Reason: Waiting to send key event because the focused window has not finished processing all of the input events that were previously delivered to it. Outbound queue length: 0. Wait queue length: 15. 04-14 20:36:41.476 V/ApplicationPolicy( 912): isApplicationStateBlocked userId 0 pkgname com.xxx.yyy 04-14 20:36:41.486 I/Process ( 912): Sending signal. PID: 30707 SIG: 3 04-14 20:36:41.486 I/art (30707): Thread[2,tid=30714,WaitingInMainSignalCatcherLoop,Thread\*=0xaf70e400,peer=0x32c07080,"Signal Catcher"]: reacting to signal 3 04-14 20:36:41.686 I/Process ( 912): Sending signal. PID: 912 SIG: 3 04-14 20:36:41.686 I/art ( 912): Thread[2,tid=918,WaitingInMainSignalCatcherLoop,Thread\*=0xaf70e400,peer=0x12c02080,"Signal Catcher"]: reacting to signal 3 04-14 20:36:41.846 E/SMD ( 287): DCD ON 04-14 20:36:42.506 I/art (30707): Wrote stack traces to '/data/anr/traces.txt'

Hi Rob,

Was the information any helpful to figure out why its crashing?

I don’t see the crash code at the top in the log at the bottom.

I also don’t know what your print debug function does either.  Please add this at the top of the listener function:

print( json.prettify( event ) )

You will need to do a:  local json = require( “json” )

at the top of your code.

Then post the log, hopefully with a crash happening.

Rob