Skip to content

Soon after granting permission and then clicking on the textinput component from react native the entire application is crashing #3561

@aRbhaSun20

Description

@aRbhaSun20

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-ui-lib/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java b/node_modules/react-native-ui-lib/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java
index 95c5e8e..cc520c7 100644
--- a/node_modules/react-native-ui-lib/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java
+++ b/node_modules/react-native-ui-lib/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java
@@ -9,7 +9,9 @@ public class RuntimeUtils {
     private static final Runnable sUIUpdateClosure = new Runnable() {
         @Override
         public void run() {
-            ReactContextHolder.getContext().getNativeModule(UIManagerModule.class).onBatchComplete();
+            if(ReactContextHolder.getContext() != null && ReactContextHolder.getContext().getNativeModule(UIManagerModule.class) != null){
+                ReactContextHolder.getContext().getNativeModule(UIManagerModule.class).onBatchComplete();
+            }
         }
     };
 
@@ -25,7 +27,14 @@ public class RuntimeUtils {
             public void run() {
                 userRunnable.run();
                 if (ReactContextHolder.getContext() != null) {
-                    ReactContextHolder.getContext().runOnNativeModulesQueueThread(sUIUpdateClosure);
+                   try { 
+                        android.utils.Log.e("RuntimeUtils". "dispatchUIUpdates: dispatchUIUpdates: running on native modules queue");
+                        ReactContextHolder.getContext().runOnNativeModulesQueueThread(sUIUpdateClosure);
+                    } catch (Exception e) {
+                        android.utils.Log.e("RuntimeUtils". "dispatchUIUpdates: runOnNativeModulesQueueThread: exception");
+                    }
+                }else {
+                        ndroid.utils.Log.e("RuntimeUtils". "dispatchUIUpdates: context is empty");
                 }
             }
         });

This issue body was partially generated by patch-package.

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