Skip to content

Remote debugger stops working after importing a library #13323

@Matko95

Description

@Matko95

Description

After importing a js library (https://github.com/orhan/react-native-openpgp) if you turn on the remote debugger, the app keeps crashing.

04-05 11:01:41.784 2775 2868 E AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher 04-05 11:01:41.784 2775 2868 E AndroidRuntime: Process: com.lemonmobileapp, PID: 2775 04-05 11:01:41.784 2775 2868 E AndroidRuntime: java.lang.IllegalStateException: Expected a name but was NUMBER 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at android.util.JsonReader.nextName(JsonReader.java:390) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at com.facebook.react.devsupport.JSDebuggerWebSocketClient.onMessage(JSDebuggerWebSocketClient.java:196) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at okhttp3.internal.ws.RealWebSocket$1.onMessage(RealWebSocket.java:62) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at okhttp3.internal.ws.WebSocketReader.readMessageFrame(WebSocketReader.java:242) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:108) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at okhttp3.internal.ws.RealWebSocket.readMessage(RealWebSocket.java:97) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at okhttp3.ws.WebSocketCall.createWebSocket(WebSocketCall.java:152) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at okhttp3.ws.WebSocketCall.access$000(WebSocketCall.java:41) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at okhttp3.ws.WebSocketCall$1.onResponse(WebSocketCall.java:97) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at okhttp3.RealCall$AsyncCall.execute(RealCall.java:126) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 04-05 11:01:41.784 2775 2868 E AndroidRuntime: at java.lang.Thread.run(Thread.java:761)

This is the stacktrace that is dumped when the app crashes.

Reproduction Steps

react-native init test
npm install --save react-native-openpgp
react-native link react-native-openpgp
//index.android.js
import * as openpgp from 'react-native-openpgp';

Possible Solution

So far the only solution I see could be in the JSDebuggerWebSocketClient.java, specifically the onMessage method, It could be that the JsonReader doesn't skip some values properly. But that's only a guess.

Additional Information

  • React Native version: [0.41.0]
  • Platform: [Android (Possibly both)]
  • Development Operating System: [Windows]
  • Dev tools: [PhpStorm, Android SDK 23]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions