From 3d09106e453391007c040cfbc4c6e83331ed2ea3 Mon Sep 17 00:00:00 2001 From: Loewy Date: Mon, 17 Nov 2025 18:58:13 -0800 Subject: [PATCH] skip native library loading for frame processors, wip: failing to launch app --- package/android/build.gradle | 1 + .../com/mrousavy/camera/CameraViewModule.kt | 26 +++++++------------ .../frameprocessor/VisionCameraProxy.kt | 7 +++-- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/package/android/build.gradle b/package/android/build.gradle index 988e829..8a009fc 100644 --- a/package/android/build.gradle +++ b/package/android/build.gradle @@ -165,6 +165,7 @@ android { "**/libhermes-executor-debug.so", "**/libhermes_executor.so", "**/libreactnativejni.so", + "**/libreactnative.so", "**/libturbomodulejsijni.so", "**/libreact_nativemodule_core.so", "**/libjscexecutor.so" diff --git a/package/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt b/package/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt index 698d805..15075d7 100644 --- a/package/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt +++ b/package/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt @@ -29,14 +29,10 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase var sharedRequestCode = 10 init { - try { - // Load the native part of VisionCamera. - // Includes the OpenGL VideoPipeline, as well as Frame Processor JSI bindings - System.loadLibrary("VisionCamera") - } catch (e: UnsatisfiedLinkError) { - Log.e(VisionCameraProxy.TAG, "Failed to load VisionCamera C++ library!", e) - throw e - } + // Skip loading native library for React Native 0.79+ compatibility + // Frame Processors are disabled (react-native-worklets-core not installed) + // The native library has incompatible JNI signatures for RN 0.79+ + Log.i(TAG, "VisionCamera native library not loaded - Frame Processors disabled for RN 0.79+ compatibility") } } @@ -73,15 +69,11 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase } @ReactMethod(isBlockingSynchronousMethod = true) - fun installFrameProcessorBindings(): Boolean = - try { - val proxy = VisionCameraProxy(reactApplicationContext) - VisionCameraInstaller.install(proxy) - true - } catch (e: Error) { - Log.e(TAG, "Failed to install Frame Processor JSI Bindings!", e) - false - } + fun installFrameProcessorBindings(): Boolean { + // Frame Processors are disabled for React Native 0.79+ compatibility + Log.i(TAG, "Frame Processor bindings not installed - Frame Processors disabled for RN 0.79+ compatibility") + return false + } @ReactMethod fun takePhoto(viewTag: Int, options: ReadableMap, promise: Promise) { diff --git a/package/android/src/main/java/com/mrousavy/camera/frameprocessor/VisionCameraProxy.kt b/package/android/src/main/java/com/mrousavy/camera/frameprocessor/VisionCameraProxy.kt index 29c483d..d77a2fe 100644 --- a/package/android/src/main/java/com/mrousavy/camera/frameprocessor/VisionCameraProxy.kt +++ b/package/android/src/main/java/com/mrousavy/camera/frameprocessor/VisionCameraProxy.kt @@ -78,6 +78,9 @@ class VisionCameraProxy(private val reactContext: ReactApplicationContext) { FrameProcessorPluginRegistry.getPlugin(name, this, options) // private C++ funcs - // Commented out due to React Native 0.79+ API compatibility issues - // private external fun initHybrid(jsContext: Long, jsCallInvokerHolder: CallInvokerHolderImpl, scheduler: VisionCameraScheduler): HybridData + // Keep this declared (even though we don't call it) so JNI can register it + // The native library expects this method signature to exist + @DoNotStrip + @Keep + private external fun initHybrid(jsContext: Long, jsCallInvokerHolder: Any, scheduler: VisionCameraScheduler): HybridData }