From fc27e89938de7fc90c0a6c18d2be8131075f6ab6 Mon Sep 17 00:00:00 2001 From: Krzysztof Piaskowy Date: Mon, 13 May 2024 09:33:56 +0200 Subject: [PATCH] Catch UnsatisfiedLinkError (#2128) ## Description Fixes https://github.com/software-mansion/react-native-screens/issues/2115 The `System.loadLibrary("rnscreens")` can throw an exception that inherits from the `Error` class instead of the `Exception` class. --- android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt b/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt index a3490fc177..e2f5332001 100644 --- a/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt +++ b/android/src/main/java/com/swmansion/rnscreens/ScreensModule.kt @@ -25,7 +25,7 @@ class ScreensModule(private val reactContext: ReactApplicationContext) } else { Log.e("[RNScreens]", "Could not install JSI bindings.") } - } catch (exception: Exception) { + } catch (exception: UnsatisfiedLinkError) { Log.w("[RNScreens]", "Could not load RNScreens module.") } }