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

NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.getRequestedOrientation()' on a null object reference #262

Open
jreason opened this issue Jan 4, 2022 · 3 comments

Comments

@jreason
Copy link

jreason commented Jan 4, 2022

Hi,

We have been getting the following error for a while now, sometimes into the hundreads per day.
It only appears to be affecting Android devices with a wide range of difference android versions and devices.
After doing some research, i thought it might be related to the Android View State which is mentioned here:
https://github.com/software-mansion/react-native-screens#android

However, after making this change, the problem still persists.
Any ideas?

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.getRequestedOrientation()' on a null object reference
at com.rssignaturecapture.RSSignatureCaptureMainView.(RSSignatureCaptureMainView.java:47)
at com.rssignaturecapture.RSSignatureCaptureViewManager.createViewInstance(RSSignatureCaptureViewManager.java:120)
at com.rssignaturecapture.RSSignatureCaptureViewManager.createViewInstance(RSSignatureCaptureViewManager.java:19)
at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:139)
at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:76)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:281)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:194)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:1110)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java:1081)
at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java:29)
at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java:175)
at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java:85)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:765)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:549)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5910)
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:1405)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1200)

@jedt
Copy link
Contributor

jedt commented Jan 4, 2022

@jreason can you make a test project please so I can check?

@jreason
Copy link
Author

jreason commented Oct 13, 2022

@jedt i have not been able to reproduce this at all in any testing environment, but my sentry logs are displaying it all the time

Screenshot 2022-10-13 at 12 26 54

@ljmzbigsmart
Copy link

Hey guys, any ideas on how to stop this problem? Just started happening to me in my last update, but users aren´t reporting anything.

Exception java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.getRequestedOrientation()' on a null object reference
  at com.rssignaturecapture.RSSignatureCaptureMainView.<init> (RSSignatureCaptureMainView.java:47)
  at com.rssignaturecapture.RSSignatureCaptureViewManager.createViewInstance (RSSignatureCaptureViewManager.java:120)
  at com.rssignaturecapture.RSSignatureCaptureViewManager.createViewInstance (RSSignatureCaptureViewManager.java:19)
  at com.facebook.react.uimanager.ViewManager.createViewInstance (ViewManager.java:176)
  at com.facebook.react.uimanager.ViewManager.createView (ViewManager.java:108)
  at com.facebook.react.uimanager.NativeViewHierarchyManager.createView (NativeViewHierarchyManager.java:281)
  at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute (UIViewOperationQueue.java:160)
  at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations (UIViewOperationQueue.java:1107)
  at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded (UIViewOperationQueue.java:1078)
  at com.facebook.react.uimanager.GuardedFrameCallback.doFrame (GuardedFrameCallback.java:29)
  at com.facebook.react.modules.core.ReactChoreographer$1.doFrame (ReactChoreographer.java:89)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1542)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1553)
  at android.view.Choreographer.doCallbacks (Choreographer.java:1109)
  at android.view.Choreographer.doFrame (Choreographer.java:984)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1527)
  at android.os.Handler.handleCallback (Handler.java:958)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loopOnce (Looper.java:257)
  at android.os.Looper.loop (Looper.java:368)
  at android.app.ActivityThread.main (ActivityThread.java:8839)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:572)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1049)

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

3 participants