marcojak / MauiMTAdmob

MIT License
104 stars 17 forks source link

Error when Dismissing Ad without Internet Connection in Android #71

Open AmperLab opened 3 months ago

AmperLab commented 3 months ago

Steps to Reproduce:

  1. Load an advertisement.
  2. View the advertisement.
  3. Disable the internet connection.
  4. Attempt to dismiss the advertisement by clicking the close (X) button.

Expected Behavior: The advertisement should be dismissed, and the application should remain functional.

Actual Behavior: After clicking the close button, a black screen appears in the application, and the following error messages are displayed in the console:

[InputMethodManager] startInputInner - Id : 0 [InputMethodManager] startInputInner - mService.startInputOrWindowGainedFocus [Ads] JS: Uncaught (in promise) TypeError: Cannot read properties of null (reading 'style') (https://www.gstatic.com/mysidia/d406f178889d2cddca4a9c8fbd7da3f0.js?tag=video_ctd/interstitial_campari_v2_hotfixable:78) [chromium] [INFO:CONSOLE(78)] "Uncaught (in promise) TypeError: Cannot read properties of null (reading 'style')", source: https://www.gstatic.com/mysidia/d406f178889d2cddca4a9c8fbd7da3f0.js?tag=video_ctd/interstitial_campari_v2_hotfixable (78) [AudioTrack] setVolume(0.000000, 0.000000) pid : 16391 [DecorView] notifyKeepScreenOnChanged: keepScreenOn=false [ViewRootImpl@6bd0042[AdActivity]] performTraversals params={(0,0)(fillxfill) sim={adjust=resize} ty=BASE_APPLICATION fmt=TRANSPARENT wanim=0x1030000 [ViewRootImpl@6bd0042[AdActivity]] fl=1810500 [ViewRootImpl@6bd0042[AdActivity]] pfl=12020040 [ViewRootImpl@6bd0042[AdActivity]] bhv=SHOW_TRANSIENT_BARS_BY_SWIPE [ViewRootImpl@6bd0042[AdActivity]] fitSides= naviIconColor=0} [ViewRootImpl@6bd0042[AdActivity]] performTraversals mFirst=false windowShouldResize=false viewVisibilityChanged=false mForceNextWindowRelayout=false params={(0,0)(fillxfill) sim={adjust=resize} ty=BASE_APPLICATION fmt=TRANSPARENT wanim=0x1030000 [ViewRootImpl@6bd0042[AdActivity]] fl=1810500 [ViewRootImpl@6bd0042[AdActivity]] pfl=12020040 [ViewRootImpl@6bd0042[AdActivity]] bhv=SHOW_TRANSIENT_BARS_BY_SWIPE [ViewRootImpl@6bd0042[AdActivity]] fitSides= naviIconColor=0} [ViewRootImpl@6bd0042[AdActivity]] updateBlastSurfaceIfNeeded mBlastBufferQueue=0xb4000076adafab10 isSameSurfaceControl=true [BLASTBufferQueue] update, w= 1080 h= 2249 mName = ViewRootImpl@6bd0042[AdActivity] mNativeObject= 0xb4000076adafab10 sc.mNativeObject= 0xb40000763daffb20 format= -2 caller= android.view.ViewRootImpl.updateBlastSurfaceIfNeeded:2898 android.view.ViewRootImpl.relayoutWindow:9847 android.view.ViewRootImpl.performTraversals:3884 android.view.ViewRootImpl.doTraversal:3116 android.view.ViewRootImpl$TraversalRunnable.run:10885 android.view.Choreographer$CallbackRecord.run:1301 [ViewRootImpl@6bd0042[AdActivity]] Relayout returned: old=(0,67,1080,2316) new=(0,67,1080,2316) req=(1080,2249)0 dur=5 res=0x0 s={true 0xb400007740cba880} ch=false seqId=0 [ViewRootImpl@6bd0042[AdActivity]] ViewPostIme pointer 0 [ViewRootImpl@6bd0042[AdActivity]] ViewPostIme pointer 1 [CCodec] [c2.android.aac.decoder] state->set(FLUSHING) [CCodec] [c2.android.aac.decoder] state->set(FLUSHED) [MediaCodec] keep callback message for reclaim [CCodec] [c2.android.aac.decoder] state->set(RESUMING) [CCodecConfig] query failed after returning 20 values (BAD_INDEX) [Codec2Client] query -- param skipped: index = 1342179345. [Codec2Client] query -- param skipped: index = 2415921170. [Codec2Client] query -- param skipped: index = 1610614798. [CCodec] [c2.android.aac.decoder] state->set(RUNNING) [CCodecBufferChannel] [c2.android.aac.decoder#129] 4 initial input buffers available [ACodec] [OMX.qcom.video.decoder.vp9] signalFlush [ACodec] [OMX.qcom.video.decoder.vp9] ExecutingState flushing now (codec owns 11/12 input, 1/20 output). [ACodec] [OMX.qcom.video.decoder.vp9] Now Flushing [ACodec] [OMX.qcom.video.decoder.vp9] FlushingState onOMXEvent(0,1,1) [ACodec] [OMX.qcom.video.decoder.vp9] FlushingState onOMXEvent(0,1,0) [ACodec] [OMX.qcom.video.decoder.vp9] Now Executing [MediaCodec] keep callback message for reclaim [CCodec] [c2.android.aac.decoder] state->set(RELEASING) [CCodecBufferChannel] [c2.android.aac.decoder#129] MediaCodec discarded an unknown buffer [CCodec] [c2.android.aac.decoder] release(1) [SurfaceUtils] connecting to surface 0xb400007740cf6250, reason connectToSurface [MediaCodec] [OMX.qcom.video.decoder.vp9] setting surface generation to 16784392 [SurfaceUtils] disconnecting from surface 0xb400007740cf6250, reason connectToSurface(reconnect) [SurfaceUtils] connecting to surface 0xb400007740cf6250, reason connectToSurface(reconnect) [CCodec] [c2.android.aac.decoder] state->set(RELEASED) [hw-BpHwBinder] onLastStrongRef automatically unlinking death recipients [MediaCodec] Codec shutdown complete [MediaCodec] flushMediametrics [SurfaceUtils] set up nativeWindow 0xb400007740cf6250 for 720x1280, color 0x7fa30c06, rotation 0, usage 0x20402900 [SurfaceUtils] disconnecting from surface 0xb40000773f4e9590, reason disconnectFromSurface [Surface] freeAllBuffers: 15 buffers were freed while being dequeued! [ACodec] [OMX.qcom.video.decoder.vp9] Now Executing->Idle [DynamiteModule] Local module descriptor class for com.google.android.gms.ads.dynamite not found. [ACodec] [OMX.qcom.video.decoder.vp9] Now Idle->Loaded [ACodec] [OMX.qcom.video.decoder.vp9] Now Loaded [DynamitePackage] Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl [ACodec] [OMX.qcom.video.decoder.vp9] Now uninitialized [ACodec] [] Now kWhatShutdownCompleted event : 8033 [SurfaceUtils] disconnecting from surface 0xb400007740cf6250, reason disconnectFromSurface [MediaCodec] Codec shutdown complete [Ads] Use RequestConfiguration.Builder().setTestDeviceIds(Arrays.asList("0B4F558796D9EAB16FF51CBBD54B4427")) to get test ads on this device. [MediaCodec] flushMediametrics [DynamiteModule] Local module descriptor class for com.google.android.gms.ads.dynamite not found. [PlayCore] UID: [10524] PID: [16391] PrewarmService : detach [PlayCore] UID: [10524] PID: [16391] PrewarmService : Unbind from service. [ConnectionStatusConfig] Dynamic lookup for intent failed for action: com.google.android.gms.ads.service.START [IMM_LC] closeCurrentInput: mService.hideSoftInput [ViewRootImpl@e6dad42[AdActivity]] stopped(false) old = false [DecorView] notifyKeepScreenOnChanged: keepScreenOn=true [MSHandlerLifeCycle] removeMultiSplitHandler: no exist. decor=DecorView@5f67e19[AdActivity] [ViewRootImpl@6bd0042[AdActivity]] handleAppVisibility mAppVisible = true visible = false [ViewRootImpl@6bd0042[AdActivity]] MSG_WINDOW_FOCUS_CHANGED 0 0 [ViewRootImpl@6bd0042[AdActivity]] stopped(true) old = false [ViewRootImpl@6bd0042[AdActivity]] WindowStopped on com.test.sampleapp/com.google.android.gms.ads.AdActivity set to true [MSHandlerLifeCycle] removeMultiSplitHandler: no exist. decor=DecorView@6799f78[AdActivity] [OpenGLRenderer] setSurface called with nullptr [OpenGLRenderer] setSurface() destroyed EGLSurface [OpenGLRenderer] destroyEglSurface [ViewRootImpl@6bd0042[AdActivity]] dispatchDetachedFromWindow [InputTransport] Input channel destroyed: '1907ba5', fd=254 [ViewRootImpl@e6dad42[AdActivity]] MSG_WINDOW_FOCUS_CHANGED 1 0

marcojak commented 3 months ago

Investigating it now...

marcojak commented 3 months ago

I've tested the MAUI version for .Net 8 on an Android phone on the latest version of the plugin and it works as expected. Of course the automatic reload of the ad, doesn't work as there is no network but I don't see any black screen. If you still have the same issue, could you provide additional info?

AmperLab commented 3 months ago

Thank you for the update. It's worth noting that the error occurs specifically on a physical Android device. I've also conducted testing on an emulator and did not encounter similar issues. I also want to mention that I upgraded from an older version of the plugin to the latest one, and the issue persists even after the update. Physical android device has API 33

marcojak commented 3 months ago

I've tried it on a Google pixel 7 pro with android 14.

What I've done:

1) load the interstitial 2) show the interstitial 3) go into airplane mode. 4) close the interstitial clicking on the X

I've tried several times and it always worked.

If there is anything else I can do to reproduce the issue, please let me know.

On Fri, 15 Mar 2024, 17:25 AmperLab, @.***> wrote:

Thank you for the update. It's worth noting that the error occurs specifically on a physical Android device. I've also conducted testing on an emulator and did not encounter similar issues. I also want to mention that I upgraded from an older version of the plugin to the latest one, and the issue persists even after the update. Physical android device has API 33

— Reply to this email directly, view it on GitHub https://github.com/marcojak/MauiMTAdmob/issues/71#issuecomment-2000015319, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUIPIQHCZR7AJPOTZS4FF3YYMOHNAVCNFSM6AAAAABEXD477CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBQGAYTKMZRHE . You are receiving this because you commented.Message ID: @.***>