Skip to content

Android: RNCallKeepModule onHostDestroy crashes Android instrumentation test runner #797

Open

Description

@mleppanen-sorenson

Bug report

  • Reproduced on:
  • Android

Description

The following code in RNCallKeepModule.java for onHostDestroy causes the Android instrumentation test runner to crash:

   Log.d(TAG, "[RNCallKeepModule] onHostDestroy executed");
   // This line will kill the android process after ending all calls
   android.os.Process.killProcess(android.os.Process.myPid());

Proposed Solution

The following code would cleanly close the app without crashing the Android instrumentation test runner:

   Log.d(TAG, "[RNCallKeepModule] onHostDestroy executed");
   // This line will cleanly close the app after ending all calls
   getCurrentReactActivity().finishAffinity();

Steps to Reproduce

Create and run an Android Espresso UI Test

Versions

- Callkeep: 4.3.12
- React Native: 0.72.3
- Android: any
- Phone model: any

Logs

2024-07-19 10:06:37.970 12560-12560 RNCallKeep               D  [RNCallKeepModule] onHostDestroy called
2024-07-19 10:06:37.978 12560-12560 RNCallKeep               D  [RNCallKeepModule] stopListenToNativeCallsState
2024-07-19 10:06:37.978 12560-12560 RNCallKeep               D  [RNCallKeepModule] onHostDestroy executed
2024-07-19 10:06:37.978 12560-12560 Process                  I  Sending signal. PID: 12560 SIG: 9
2024-07-19 10:06:38.072 13142-13142 WindowOnBackDispatcher   W  sendCancelIfRunning: isInProgress=falsecallback=android.view.ViewRootImpl$$ExternalSyntheticLambda11@cf6b1b2
2024-07-19 10:06:38.097  1488-2809  ActivityManager          W  Crash of app com.xxxx.xxxx running instrumentation ComponentInfo{com.xxxx.xxxx.test/androidx.test.runner.AndroidJUnitRunner}

Activity

  1. github-actions commented on Oct 17, 2026

    @github-actions

    This issue has had no activity for two years, so it will be closed in 30 days. If it still happens with the latest release, please comment with your react-native-callkeep, React Native and OS versions, and it will stay open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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