appodeal / react-native-appodeal

Official React Native package that adds Appodeal SDK support to your react-native application.
https://appodeal.com
59 stars 37 forks source link

Android: Null pointer exception - Attempt to invoke virtual method void android.view.View.setVisibility(int) #50

Closed zoftify closed 3 years ago

zoftify commented 3 years ago

Hi,

We're seeing this issue quite often on Android (via crashlytics).

Maybe worth adding a null pointer check prior to setting the visibility?

Thanks

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setVisibility(int)' on a null object reference
       at com.reactlibrary.RCTAppodealBannerView.showBannerView(RCTAppodealBannerView.java:110)
       at com.reactlibrary.RCTAppodealBannerView.onLayout(RCTAppodealBannerView.java:133)
       at android.view.View.layout(View.java:23754)
       at android.view.ViewGroup.layout(ViewGroup.java:7277)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.updateLayout(NativeViewHierarchyManager.java:252)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.updateLayout(NativeViewHierarchyManager.java:220)
       at com.facebook.react.uimanager.UIViewOperationQueue$UpdateLayoutOperation.execute(UIViewOperationQueue.java:155)
       at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:792)
       at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:903)
       at com.facebook.react.uimanager.UIViewOperationQueue.access$2400(UIViewOperationQueue.java:43)
       at com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded(UIViewOperationQueue.java:861)
       at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:31)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:237)
       at android.app.ActivityThread.main(ActivityThread.java:7948)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
staskochkin commented 3 years ago

Hi @zoftify Thank you for your feedback. We will fix it next release.

alex-ragin commented 3 years ago

Hi @staskochkin, any plans when those fixes will be released?

staskochkin commented 3 years ago

Hi @alex-ragin, we plan to release these updates with the next update of Appodeal SDK. ETA is the end of this week.

staskochkin commented 3 years ago

Fix has been released in 2.7.4