Open arekm213 opened 3 months ago
in the file a/node_modules/react-native-volume-manager/android/src/main/java/com/reactnativevolumemanager/VolumeManagerModule.java b/node_modules/react-native-volume-manager/android/src/main/java/com/reactnativevolumemanager/VolumeManagerModule.java
, in the setupKeyListener
method you can add a condition to see if the mContext exists, like this:
private void setupKeyListener() {
runOnUiThread(() -> {
if (mContext.getCurrentActivity() == null) return;
View rootView =
...
}
While you won't have this fix in the lib, you can make this change and then use this command in your project's terminal:
npx patch-package react-native-volume-manager
this will create a patch with the changes (the file shouldn't be large when created, it should only have the changes) and whenever you install node_modules it will use this patch to make your change.
this error is similar to this one:
https://github.com/hirbod/react-native-volume-manager/pull/28
We are getting a lot of error reports like this in our app which uses your library:
Could you please think about proper fix for this? We are currently early returning in
setupKeyListener
method ifmContext.getCurrentActivity()
returnsnull
, but this probably could be handled better This happens on"react-native": "0.68.7"
, unfortunately im not able to reproduce this issue myself