Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE MobFoxWebView #52

Closed
andypoptacular opened this issue Jan 27, 2017 · 10 comments
Closed

NPE MobFoxWebView #52

andypoptacular opened this issue Jan 27, 2017 · 10 comments

Comments

@andypoptacular
Copy link

andypoptacular commented Jan 27, 2017

I've recently integrated the Mobfox SDK into our app and are using the MoPub adaptor to show banners. The following crashes seems to be occurring, do you have any ideas about what could be causing it?

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void com.mobfox.sdk.webview.MobFoxWebView$Listener.onAdResponse(com.mobfox.sdk.webview.MobFoxWebView, org.json.JSONObject)' on a null object reference
at com.mobfox.sdk.webview.MobFoxWebView$7$1.run(MobFoxWebView.java:191)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6934)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void com.mobfox.sdk.webview.MobFoxWebView$Listener.onError(com.mobfox.sdk.webview.MobFoxWebView, java.lang.Exception)' on a null object reference
at com.mobfox.sdk.webview.MobFoxWebView$7$3.run(MobFoxWebView.java:217)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7229)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'void com.mobfox.sdk.webview.MobFoxWebView$Listener.onNoAd(com.mobfox.sdk.webview.MobFoxWebView)' on a null object reference
at com.mobfox.sdk.webview.MobFoxWebView$7$2.run(MobFoxWebView.java:206)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5938)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)

@nabriski
Copy link
Contributor

Hi,

I just uploaded a version with a workaround.
We are still trying to reproduce this situation but the fix should return a standard timeout for this scenario.
We have two more reports of this happening sporadically, can you reproduce it consistently?

Thanks

@andypoptacular
Copy link
Author

Hi,

I'm still getting many crash reports with the same error. Sorry, I haven't seen it myself so I don't know what triggers it. From the look of the app logs a new activity is loaded and the crash occurs shortly after (assumably when the Mobfox banner load is attempted). Did your fix work for other people? Could the offending code be wrapped in a 'try catch' so at least it doesn't crash the app?

Thanks.

@nabriski
Copy link
Contributor

nabriski commented Feb 2, 2017 via email

@nabriski
Copy link
Contributor

nabriski commented Feb 2, 2017

Hi,

You mentioned an activity, is this a problem with interstitials?

Thanks

@andypoptacular
Copy link
Author

andypoptacular commented Feb 2, 2017 via email

@nabriski
Copy link
Contributor

nabriski commented Feb 2, 2017 via email

@nabriski
Copy link
Contributor

nabriski commented Feb 2, 2017

Ok, we understand the problem now. It appears the fix released is sufficient but we are now working in producing a unit test for this scenario to fully verify this.

@andypoptacular
Copy link
Author

andypoptacular commented Feb 2, 2017 via email

@nabriski
Copy link
Contributor

nabriski commented Feb 2, 2017 via email

@nabriski
Copy link
Contributor

nabriski commented Feb 5, 2017

Hi,
In order to verify this 100% we are refactoring our code to be more testable in this aspect.
I would suggest to go live with the present version as this refactoring is something we need to test as well and it does not differ functionally from the present version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants