Closed emptyopen closed 3 years ago
From looking at your logs, the user reward callback is invoked the same number of times as the onAdOpened and onAdClosed callback: The number of (User rewarded: ca-app-pub-3940256099942544/5224354917, 10 coins
) matches the number of Ad opened: ca-app-pub-3940256099942544/5224354917
and Ad closed: ca-app-pub-3940256099942544/5224354917
. This suggests that there isn't an issue with the reward callback not being invoked.
May be tangentially related, but you should also be calling ad.dispose()
from onAdClosed
and onAdFailedToLoad
.
Also the logs you are seeing looks to be the entire adb logcat
. You can filter for the messages from flutter by running adb logcat -s flutter
@jjliu15 thanks for responding to my melodramatic post. I had ad.dispose()
on onAdFailedToLoad
, but not onAdClosed
, i did add that to my listener, but still having the same issue. i'll look into dispose
a bit more.
also thanks for the adb logcat -s flutter
command, definitely helpful.
also to follow up on the noisy log messages, if it helps anyone I realized I could just filter by I/flutter
in my debug console in VS code to just see the flutter messages, doh
@emptyopen Is your issue resolved?
no, but perhaps it is a complex interaction with the behavior of flame
. it's a minor inconvenience not being able to display a banner on the home page, but it's not a huge deal. can close this, and I'll continue to try and find a root cause down the line.
I'm not sure where to start because of all the log messages. Absolutely flooded, I can't tell up from down. Seriously, what is the possible benefit of the log message
setVertexArrayObject: set vao to 48 (48) 0 0
, orconnecting to surface 0xb31f0808, reason connectToSurface(reconnect)
. The pain cannot be understated. However, the culprit seems to be strongly linked to the log message#004 The webview is destroyed. Ignoring action.
The difficult aspect of this issue is that it seems to be intermittent. Sometimes I run a rewarded ad and it works, other times it doesn't.
Basically, the issue is that after playing a rewarded ad, the callback I have in the
onRewardedAdUserEarnedReward
function in the AdListener does not run. This is obviously bad, because the user will have sat through an ad for no reason.Plugin Version
from pubspec.yaml:
google_mobile_ads: ^0.12.1
Steps to Reproduce
I have this
AdState.dart
, with relevant parts shown:ui
isflame
's ui, but is basically just a class I'm calling an internal function.Expected results:
Ad runs, I close it, functions are run without issue.
Actual results:
Functions do not run. My log window is blown out of the water.
How am I supposed to work with this:
flutter analyze (this def doesn't matter):
flutter doctor