Closed DFreds closed 4 years ago
Hi there. I'll take a look at your error and see what I think it is....
Oh yes, I see the issue..... I think anyway. Video ads are such a resource hog. I'll make some changes in the hope to relieve us of such errors for both the interstitial and video ads. A release by the end of the day.
Regards,
Greg
Amazing! Thanks Greg
0.12.0 has been deployed. I'd like to think it'll work now without error.
Greg
I'll give it a shot and let you know.
Hey, I'm unfortunately still getting the same exact issue in 0.12.0.
I am loading both the interstitial and reward video ad on app initialization. This seems to cause the onAdFailedToLoad/onRewardedVideoAdFailedToLoad errors.
If I trigger the interstitial, I get the onAdFailedToLoad message every time. If I trigger the rewarded video, it seems to alternate between throwing the error and showing the onRewardedVideoAdFailedToLoad.
Again, it shows the test ads fine in debug mode.
W/flutter ( 8840): onAdFailedToLoad: 3
W/flutter ( 8840): onRewardedVideoAdFailedToLoad: 3
E/flutter ( 8840): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(ad_not_loaded, show failed for rewarded video, no ad was loaded, null)
E/flutter ( 8840): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564)
E/flutter ( 8840): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316)
E/flutter ( 8840): <asynchronous suspension>
E/flutter ( 8840): #2 _invokeBooleanMethod (package:firebase_admob/firebase_admob.dart:518)
E/flutter ( 8840): <asynchronous suspension>
E/flutter ( 8840): #3 RewardedVideoAd.show (package:firebase_admob/firebase_admob.dart:392)
E/flutter ( 8840): #4 Ads.showVideoAd (package:ads/ads.dart:408)
E/flutter ( 8840): #5 AppAds.showVideoAd (package:tabletop_dice/util/app_ads.dart:68)
E/flutter ( 8840): #6 MainScreen._buildAppBar.<anonymous closure> (package:tabletop_dice/screens/main_screen.dart:98)
E/flutter ( 8840): #7 _PopupMenuButtonState.showButtonMenu.<anonymous closure> (package:flutter/src/material/popup_menu.dart:0)
E/flutter ( 8840): #8 _rootRunUnary (dart:async/zone.dart:1132)
E/flutter ( 8840): #9 _CustomZone.runUnary (dart:async/zone.dart:1029)
E/flutter ( 8840): #10 _FutureListener.handleValue (dart:async/future_impl.dart:126)
E/flutter ( 8840): #11 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639)
E/flutter ( 8840): #12 Future._propagateToListeners (dart:async/future_impl.dart:668)
E/flutter ( 8840): #13 Future._completeWithValue (dart:async/future_impl.dart:483)
E/flutter ( 8840): #14 Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:513)
E/flutter ( 8840): #15 _rootRun (dart:async/zone.dart:1124)
E/flutter ( 8840): #16 _CustomZone.run (dart:async/zone.dart:1021)
E/flutter ( 8840): #17 _CustomZone.runGuarded (dart:async/zone.dart:923)
E/flutter ( 8840): #18 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963)
E/flutter ( 8840): #19 _microtaskLoop (dart:async/schedule_microtask.dart:41)
E/flutter ( 8840): #20 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
Oh I see. However, it works in debug mode? That's a surprise frankly. Obviously we're missing something here. I'll take a look in a few hours. I may be back to you with some questions in trying to pinpoint the problem.
Oops. I suspect you're not using 0.12.0
If you were using 0.12.0, I would think the line number for Ads.showVideoAd would be line, 415
However, like the old version, the call is still on line 408:
E/flutter (12657): #4 Ads.showVideoAd (package:ads/ads.dart:408)
Hmmm that's interesting. My pubspec.lock file updated to 0.12.0 though. Let me clear the build and try again.
I can verify that it keeps happening. I do think that something must have been wrong before, as I'm no longer getting the exception for tapping the video ad. I only get the onRewardedVideoAdFailedToLoad now. However, I now get this when showing the interstitial ad the SECOND time I try to show it. The first time it just doesn't do anything.
E/flutter (18307): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: NoSuchMethodError: The method 'show' was called on null.
E/flutter (18307): Receiver: null
E/flutter (18307): Tried calling: show()
E/flutter (18307): #0 Ads.showFullScreenAd (package:ads/ads.dart:330)
E/flutter (18307): <asynchronous suspension>
E/flutter (18307): #1 AppAds.showFullscreenAd (package:tabletop_dice/util/app_ads.dart:50)
E/flutter (18307): #2 _addRecentRoll (package:tabletop_dice/middleware/app_middleware.dart:212)
E/flutter (18307): <asynchronous suspension>
E/flutter (18307): #3 TypedMiddleware.call (package:redux/src/utils.dart:218)
E/flutter (18307): #4 Store._createDispatchers.<anonymous closure> (package:redux/src/store.dart:238)
E/flutter (18307): #5 TypedMiddleware.call (package:redux/src/utils.dart:220)
E/flutter (18307): #6 Store._createDispatchers.<anonymous closure> (package:redux/src/store.dart:238)
E/flutter (18307): #7 TypedMiddleware.call (package:redux/src/utils.dart:220)
E/flutter (18307): #8 Store._createDispatchers.<anonymous closure> (package:redux/src/store.dart:238)
E/flutter (18307): #9 TypedMiddleware.call (package:redux/src/utils.dart:220)
E/flutter (18307): #10 Store._createDispatchers.<anonymous closure> (package:redux/src/store.dart:238)
E/flutter (18307): #11 TypedMiddleware.call (package:redux/src/utils.dart:220)
E/flutter (18307): #12 Store._createDispatchers.<anonymous closure> (package:redux/src/store.dart:238)
E/flutter (18307): #13 TypedMiddleware.call (package:redux/src/utils.dart:220)
E/flutter (18307): #14 Store._createDispatchers.<anonymous closure> (package:redux/src/store.dart:238)
E/flutter (18307): #15 TypedMiddleware.call (package:redux/src/utils.dart:220)
E/flutter (18307): #16 Store._createDispatchers.<anonymous closure> (package:redux/src/store.dart:238)
E/flutter (18307): #17 TypedMiddleware.call (package:redux/src/utils.dart:220)
E/flutter (18307): #18 Store._createDispatchers.<anonymous closure> (package:redux/src/store.dart:238)
E/flutter (18307): #19 _analytics (package:tabletop_dice/middleware/app_middleware.dart:32)
E/flutter (18307): <asynchronous suspension>
E/flutter (18307): #20 TypedMiddleware.call (package:redux/src/utils.dart:218)
E/flutter (18307): #21 Store._createDispatchers.<anonymous closure> (package:redux/src/store.dart:238)
E/flutter (18307): #22 _log (package:tabletop_dice/middleware/app_middleware.dart:27)
E/flutter (18307): <asynchronous suspension>
E/flutter (18307): #23 TypedMiddleware.call (package:redux/src/utils.dart:218)
E/flutter (18307): #24 Store._createDispatchers.<anonymous closure> (package:redux/src/store.dart:238)
E/flutter (18307): #25 Store.dispatch (package:redux/src/store.dart:250)
E/flutter (18307): #26 _ViewModel.fromStore.<anonymous closure> (package:tabletop_dice/containers/roll_button.dart:84)
E/flutter (18307): #27 RollButton._showRollResultDialog.<anonymous closure>.<anonymous closure> (package:tabletop_dice/containers/roll_button.dart:53)
E/flutter (18307): #28 _RollResultDialogState._roll (package:tabletop_dice/screens/roll_result_dialog.dart:193)
E/flutter (18307): <asynchronous suspension>
E/flutter (18307): #29 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:635)
E/flutter (18307): #30 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:711)
E/flutter (18307): #31 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182)
E/flutter (18307): #32 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:365)
E/flutter (18307): #33 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:275)
E/flutter (18307): #34 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:455)
E/flutter (18307): #35 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:75)
E/flutter (18307): #36 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:102)
E/flutter (18307): #37 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218)
E/flutter (18307): #38 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198)
E/flutter (18307): #39 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156)
E/flutter (18307): #40 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102)
E/flutter (18307): #41 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86)
E/flutter (18307): #42 _rootRunUnary (dart:async/zone.dart:1136)
E/flutter (18307): #43 _CustomZone.runUnary (dart:async/zone.dart:1029)
E/flutter (18307): #44 _CustomZone.runUnaryGuar
W/flutter (18307): onAdFailedToLoad: 3
I'm not getting this errors in debug mode of course. I'm going to do some further testing. Thanks for letting me know you're getting these issues: I've not received such problems from others. There will have to be a 'rewrite' of sorts next week to get the code itself more manageable.
Sure, sounds good. Let me know if I can offer any other information. Again, I'm getting no issues in debug with the test IDs either. It's just when building for release and attempting to see some real ads.
Here you are. 1.0.1 is now available. Since it's in the public domain, its version number now begins with 1.
Great, I'll try it out ASAP.
Were you able to get real ads to show?
Basically, I'm still getting the "3" errors for failing to load. I'm totally willing to accept that it is something I'm doing though.
No. I have yet to install the latest version in a production app. Not enough time in the day. Note, I've been told now such an error ( error number 3) will continue if the app is not yet published on the google play store.
Ahh. I was wondering if my app not being published yet was the issue. That's on me, sorry about that. I'll be publishing within the next week so I'll definitively know then. Thanks for all your work, you're a huge help. I'm thinking I'll close this and only reopen it if the problem occurs after publishing.
Ads work in production. Closing!
Ads work in production. Closing!
so how did it work in the end?
I'm getting the following logs on app start in release mode when I load both my interstitial and reward ad (only on Android). I am not doing any of my own printing here, so I'm unsure where they come from.
W/flutter (12657): onAdFailedToLoad: 3 W/flutter (12657): onRewardedVideoAdFailedToLoad: 3
Then, when I try to open the rewarded ad, I either get this exception or the
onRewardedVideoAdFailedToLoad
shown above.Here is my app_ads.dart wrapper.
Any ideas? Building for debug mode shows the test interstitial and test reward ad fine. I also have the "Your account is approved. Congratulations! We've verified your account information and your ad serving is enabled." message from Admob, so I don't think it is related to that config. I've double checked all my IDs as well.