Crash on RewardedVideo Completed on Android(appodeal)

Hello everyone.

I am using appodeal.

When rewardedVideo is displayed, after displaying advertisements of a few seconds, the application crash always occurs when the advertisement is completed.

It happens only with rewardedVideo (it does not happen with banner and interstitial)

Is there any solution?

I am sorry for my poor English.

[System]

Android version : 7.0

Corona SDK version : 2018.3347

[Code]

local appodeal = require( "plugin.appodeal" ) local CW, CH = display.contentWidth, display.contentHeight local function btnListener(event) if (event.phase == "ended") then appodeal.show("rewardedVideo") end return true end local btn = display.newImageRect("btn.png", 40, 40) btn.x, btn.y = CW/2, CH/2 btn:addEventListener("touch", btnListener) local function adListener( event ) for k, v in pairs(event) do print("Appodeal event", k, "v", v) end end appodeal.init( adListener, { appKey="my-appodeal-key", testMode=false } )

[build.settings]

settings = { orientation = { default = "landscapeRight", supported = {"landscapeRight", "landscapeLeft"}, }, android = { installLocation = "preferExternal", minSdkVersion = "19", usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.WRITE\_EXTERNAL\_STORAGE", }, }, plugins = { --Appodeal Base ['plugin.appodeal.base'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.AmazonAds'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.GoogleAdMob'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.TwitterMoPub'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' }, --Appodeal Banner ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Yandex'] = { publisherId = 'com.coronalabs' }, --Appodeal Interstitial ['plugin.appodeal.AdColony'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.IronSource'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Mobvista'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Ogury'] = { publisherId = 'com.coronalabs' }, --Appodeal Rewarded Video ['plugin.appodeal.AdColony'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.AppLovin'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Chartboost'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.FacebookAudience'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Flurry'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.InMobi'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.IronSource'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Mobvista'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.MyTarget'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.StartApp'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Unity'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Vungle'] = { publisherId = 'com.coronalabs' }, ['plugin.appodeal.Tapjoy'] = { publisherId = 'com.coronalabs' }, }, }

[crash log]

09-15 12:09:49.643: D/AES(2355): Build: asus/JP\_Phone/ASUS\_X008\_1:7.0/NRD90M/JP\_Phone-14.13.1711.87-20171201:user/release-keys 09-15 12:09:49.643: D/AES(2355): java.lang.AbstractMethodError: abstract method "void com.google.android.gms.ads.reward.RewardedVideoAdListener.onRewardedVideoCompleted()" 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.internal.ads.zzahj.onRewardedVideoCompleted(Unknown Source) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.internal.ads.zzahf.dispatchTransaction(Unknown Source) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.internal.ads.zzek.onTransact(Unknown Source) 09-15 12:09:49.643: D/AES(2355): at android.os.Binder.transact(Binder.java:504) 09-15 12:09:49.643: D/AES(2355): at mz.b(:com.google.android.gms.dynamite\_adsdynamite@13280050@13.2.80 (040406-211705629):19) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.ads.internal.reward.client.n.e(:com.google.android.gms.dynamite\_adsdynamite@13280050@13.2.80 (040406-211705629):24) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.ads.internal.a.h(:com.google.android.gms.dynamite\_adsdynamite@13280050@13.2.80 (040406-211705629):170) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.ads.internal.reward.e.m\_(:com.google.android.gms.dynamite\_adsdynamite@13280050@13.2.80 (040406-211705629):101) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.ads.internal.reward.mediation.h.g(:com.google.android.gms.dynamite\_adsdynamite@13280050@13.2.80 (040406-211705629):37) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.ads.internal.reward.client.p.e(:com.google.android.gms.dynamite\_adsdynamite@13280050@13.2.80 (040406-211705629):81) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.ads.internal.a.h(:com.google.android.gms.dynamite\_adsdynamite@13280050@13.2.80 (040406-211705629):170) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.ads.internal.aj.X(:com.google.android.gms.dynamite\_adsdynamite@13280050@13.2.80 (040406-211705629):169) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.ads.internal.gmsg.al.a(:com.google.android.gms.dynamite\_adsdynamite@13280050@13.2.80 (040406-211705629):9) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.ads.internal.webview.j.b(:com.google.android.gms.dynamite\_adsdynamite@13280050@13.2.80 (040406-211705629):90) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.ads.internal.webview.ac.run(Unknown Source) 09-15 12:09:49.643: D/AES(2355): at android.os.Handler.handleCallback(Handler.java:836) 09-15 12:09:49.643: D/AES(2355): at android.os.Handler.dispatchMessage(Handler.java:103) 09-15 12:09:49.643: D/AES(2355): at com.google.android.gms.ads.internal.util.f.dispatchMessage(:com.google.android.gms.dynamite\_adsdynamite@13280050@13.2.80 (040406-211705629):3) 09-15 12:09:49.643: D/AES(2355): at android.os.Looper.loop(Looper.java:208) 09-15 12:09:49.643: D/AES(2355): at android.app.ActivityThread.main(ActivityThread.java:6267) 09-15 12:09:49.643: D/AES(2355): at java.lang.reflect.Method.invoke(Native Method) 09-15 12:09:49.643: D/AES(2355): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1063) 09-15 12:09:49.643: D/AES(2355): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:924)

I just checked on my app and it works as expected.

  1. I am using the beta version of Appodeal. Can you give that a try?

  2. Did you sync up your account with Admob using the Appodeal Chrome plugin?

  3. Try eliminating some of those plugins and see if it works.

The app I just tested that works looks like this:

['plugin.appodeal.beta.base'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.AmazonAds'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.TwitterMoPub'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.GoogleAdMob'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.IronSource'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.StartApp'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.Vungle'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.FacebookAudience'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android = true, iphone=true} }

Agramonte, Thank you for your polite reply.

Amazingly, using a beta version no longer crashes!

Why?

I spent three days on this problem.

Thanks to you I solved it.

I am very grateful to you.

Anytime and you are welcome. No idea the but the beta has been more stable for me the last few months.

Same issue occurs with Vungle reward ads sporadically.

We also had this problem, and using the beta plugin fixed the crash. Can anyone at Corona update us on why the main plugin crashes? Of all the plugins Corona has available, I’d expect Appodeal to be the one has the best support. 

On a related note, when we previously used the regular Appodeal plugin we didn’t add the WRITE_EXTERNAL_STORAGE permission to our build.settings. I imagine that this reduces fill if it’s not allowed, but we can live with that. At any rate, I don’t believe it needs to be manually requested for API <19. When I use the beta plugin however, when the app starts I get a Toast popup saying:

Missing permissions: android.permission.WRITE\_EXTERNAL\_STORAGE

The plugin still seems to work (I can get rewarded ads etc) so the permission appears to be optional. So why does this Toast appear? It’s certainly not something we’d want the user to see anyway, it’s the kind of thing you’d only expect the developer to see. Is there a way to get rid of it?  

Edit: Actually, don’t plugins usually automatically add the permissions they need? So if the plugin needs WRITE_EXTERNAL_STORAGE, shouldn’t it just add it regardless of the permissions I have in build.settings?

@Alan
 
You can disable the popup by setting disableWriteExternalPermissionCheck parameter to true (see here https://docs.coronalabs.com/plugin/appodeal/init.html#disablewriteexternalpermissioncheck-optional))
 
WRITE_EXTERNAL_STORAGE permission belongs to dangerous permission and can’t be granted only by declaring in the manifest. So if your app isn’t requesting it in the runtime it won’t be granted.

Regarding beta and stable, we are using the same convention as native Appodeal plugins. And it seems beta Appodeal plugin is more reliable than the stable one. They must be working on it harder to push it stable channel faster.  

Thanks Bektur, I was looking on the main appodeal.* docs page and didn’t think to look in the init function as assumed it would be a build.settings type of change.

What’s the story with this. If I want to implement Ads, is Appodeal the best one for CoronaSDK as Appodeal owns Corona Labs? And what’s this about the Beta version of the plugin working better than the other? Any help is very much appreciated.

I just checked on my app and it works as expected.

  1. I am using the beta version of Appodeal. Can you give that a try?

  2. Did you sync up your account with Admob using the Appodeal Chrome plugin?

  3. Try eliminating some of those plugins and see if it works.

The app I just tested that works looks like this:

['plugin.appodeal.beta.base'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.AmazonAds'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.TwitterMoPub'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.GoogleAdMob'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.IronSource'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.StartApp'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.Vungle'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android=true, iphone=true} }, ['plugin.appodeal.beta.FacebookAudience'] = { publisherId = 'com.coronalabs', supportedPlatforms = { android = true, iphone=true} }

Agramonte, Thank you for your polite reply.

Amazingly, using a beta version no longer crashes!

Why?

I spent three days on this problem.

Thanks to you I solved it.

I am very grateful to you.

Anytime and you are welcome. No idea the but the beta has been more stable for me the last few months.

Same issue occurs with Vungle reward ads sporadically.

We also had this problem, and using the beta plugin fixed the crash. Can anyone at Corona update us on why the main plugin crashes? Of all the plugins Corona has available, I’d expect Appodeal to be the one has the best support. 

On a related note, when we previously used the regular Appodeal plugin we didn’t add the WRITE_EXTERNAL_STORAGE permission to our build.settings. I imagine that this reduces fill if it’s not allowed, but we can live with that. At any rate, I don’t believe it needs to be manually requested for API <19. When I use the beta plugin however, when the app starts I get a Toast popup saying:

Missing permissions: android.permission.WRITE\_EXTERNAL\_STORAGE

The plugin still seems to work (I can get rewarded ads etc) so the permission appears to be optional. So why does this Toast appear? It’s certainly not something we’d want the user to see anyway, it’s the kind of thing you’d only expect the developer to see. Is there a way to get rid of it?  

Edit: Actually, don’t plugins usually automatically add the permissions they need? So if the plugin needs WRITE_EXTERNAL_STORAGE, shouldn’t it just add it regardless of the permissions I have in build.settings?

@Alan
 
You can disable the popup by setting disableWriteExternalPermissionCheck parameter to true (see here https://docs.coronalabs.com/plugin/appodeal/init.html#disablewriteexternalpermissioncheck-optional))
 
WRITE_EXTERNAL_STORAGE permission belongs to dangerous permission and can’t be granted only by declaring in the manifest. So if your app isn’t requesting it in the runtime it won’t be granted.

Regarding beta and stable, we are using the same convention as native Appodeal plugins. And it seems beta Appodeal plugin is more reliable than the stable one. They must be working on it harder to push it stable channel faster.  

Thanks Bektur, I was looking on the main appodeal.* docs page and didn’t think to look in the init function as assumed it would be a build.settings type of change.

What’s the story with this. If I want to implement Ads, is Appodeal the best one for CoronaSDK as Appodeal owns Corona Labs? And what’s this about the Beta version of the plugin working better than the other? Any help is very much appreciated.