iterable-android-sdk icon indicating copy to clipboard operation
iterable-android-sdk copied to clipboard

IterableInAppFragmentHTMLNotification crash due to null context

Open hangduykhiem opened this issue 3 years ago • 2 comments

SDK Version: 3.4.8

Here's the stacktrace from our Firebase:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
       at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:141)
       at com.iterable.iterableapi.IterableInAppFragmentHTMLNotification.hideWebView(IterableInAppFragmentHTMLNotification.java:381)
       at com.iterable.iterableapi.IterableInAppFragmentHTMLNotification.onUrlClicked(IterableInAppFragmentHTMLNotification.java:257)
       at com.iterable.iterableapi.IterableWebViewClient.shouldOverrideUrlLoading(IterableWebViewClient.java:15)
       at android.webkit.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:83)
       at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:15)
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:335)
       at android.os.Looper.loopOnce(Looper.java:186)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8669)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)

It seems that this DialogFragment is somehow disconnected from the activity and thus have no valid context. However I don't know how that is possible, seeing that the meethod is triggered by onUrlClicked.

Some additional information:

Devices affected Screenshot 2022-08-19 at 10 40 48

Android OS Screenshot 2022-08-19 at 10 41 03

Everything seems to be in foreground as well.

hangduykhiem avatar Aug 19 '22 07:08 hangduykhiem

Thanks for reporting @hangduykhiem. There is a 400ms wait before the webView dismisses when clicked on, which ideally gives enough time for the dismiss animation to complete. Permalink

Can you confirm this behavior with inApps without animation too?

Ayyanchira avatar Aug 19 '22 21:08 Ayyanchira

Seeing this issue as well on 3.4.6

upside-sarah avatar Aug 29 '22 13:08 upside-sarah

@Ayyanchira thanks for the update-when can we expect a release for this fix?

upside-sarah avatar Feb 27 '23 18:02 upside-sarah

Within first week of march mostly :)

Ayyanchira avatar Feb 27 '23 18:02 Ayyanchira