1

I'm playing around with trying to add the react-native-dualscreeninfo to my existing React Native project. However, when adding the gradle requirements to get it running (just the Kotlin version, and I've also added the maven for the SDK feed), I annoyingly just get a crash that says "Stub!". I can't screenshot it in the app- it just crashes- but here's a stack from Android Studio:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.microsoft.connectedstoreremotecontrol, PID: 20436
    java.lang.RuntimeException: Stub!
        at d.d.b.a.a.a(:88)
        at com.microsoft.reactnativedualscreen.dualscreen.DualScreenInfo.getMDisplayMask(:23)
        at com.microsoft.reactnativedualscreen.dualscreen.DualScreenInfo.getHinge(:32)
        at com.microsoft.reactnativedualscreen.dualscreen.DualScreenInfo.isSpanning(:101)
        at com.microsoft.reactnativedualscreen.dualscreen.DualScreenInfo.emitUpdateStateEvent(:123)
        at com.microsoft.reactnativedualscreen.dualscreen.DualScreenInfo.access$emitUpdateStateEvent(:20)
        at com.microsoft.reactnativedualscreen.dualscreen.a.onLayoutChange(:76)
        at android.view.View.layout(View.java:22565)
        at android.view.ViewGroup.layout(ViewGroup.java:6304)
        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3170)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2626)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1756)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7815)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1036)
        at android.view.Choreographer.doCallbacks(Choreographer.java:859)
        at android.view.Choreographer.doFrame(Choreographer.java:794)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1021)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7402)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Frustratingly, I can get the example projects to build and run, so I think it's something in my project setup, and not the emulator.

Has anyone run into this and been able to get around it? Very excited to start developing, but this roadblock is a big one.

Thanks!

SFX
  • 169
  • 11
  • There is more feedback on the cross-posted GitHub issue https://github.com/microsoft/react-native-dualscreen/issues/61#issuecomment-813558989 – Conceptdev Apr 13 '21 at 16:12

1 Answers1

2

My team just ran into this issue and tracked it down to a Proguard/R8 configuration bug - we were only hitting this problem in release builds where we had minification enabled.

-keep class com.microsoft.device.display.** { *; }

in our configuration seems to have addressed the problem.

Sapph
  • 6,118
  • 1
  • 29
  • 32