Skip to content

App crash when trying to close shell #22

@bodaghialib4

Description

@bodaghialib4

hi,

I am using react-native-ssh-sftp as an ssh shell. It works fine. But when I try to close the ssh shell, my app crash.
I get the below logs from adb logcat command.

RNSSHClient: Error starting shell: Stream closed
AndroidRuntime: FATAL EXCEPTION: Thread-19
AndroidRuntime: Process: com.remotefilemanager, PID: 10904
AndroidRuntime: java.lang.RuntimeException: Illegal callback invocation from native module. This callback type only permits a single invocation from native code.
AndroidRuntime: 	at com.facebook.react.bridge.CallbackImpl.invoke(CallbackImpl.java:25)
AndroidRuntime: 	at com.reactlibrary.RNSshClientModule$3.run(RNSshClientModule.java:200)
AndroidRuntime: 	at java.lang.Thread.run(Thread.java:919)
ActivityTaskManager:   Force finishing activity com.remotefilemanager/.MainActivity

It seems that the callback of startShell invoked more than one time. first when the shell started correctly and then when I closed the shell and got the error in reading from the stream(BufferedReader).

Please help me to fix this problem.

my testing enviroment information:

  • platform: android 10 (emulator)
  • react: "16.9.0"
  • react-native: "0.61.5"
  • react-native-ssh-sftp: "^1.0.3",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions