我正在尝试将 react-native-dualscreeninfo 添加到我现有的 React Native 项目中。但是,当添加 gradle 要求以使其运行时(仅 Kotlin 版本,并且我还为 SDK 提要添加了 maven),我烦人地只是得到一个显示“存根!”的崩溃。我无法在应用程序中对其进行截图——它只是崩溃了——但这里有一个来自 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)
令人沮丧的是,我可以构建和运行示例项目,所以我认为这是我的项目设置中的东西,而不是模拟器。
有没有人遇到过这个并能够绕过它?很高兴开始开发,但这个障碍是一个很大的障碍。
谢谢!