iterable-android-sdk
iterable-android-sdk copied to clipboard
IterableInAppFragmentHTMLNotification crash due to null context
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

Android OS

Everything seems to be in foreground as well.
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?
Seeing this issue as well on 3.4.6
@Ayyanchira thanks for the update-when can we expect a release for this fix?
Within first week of march mostly :)