Compare commits
1 Commits
bump-react
...
bump-react
| Author | SHA1 | Date | |
|---|---|---|---|
| ac06fa5f56 |
@@ -60,13 +60,13 @@ target_include_directories(
|
||||
# Link everything together
|
||||
target_link_libraries(
|
||||
${PACKAGE_NAME}
|
||||
${LOG_LIB} # <-- Logcat logger
|
||||
android # <-- Android JNI core
|
||||
ReactAndroid::jsi # <-- RN: JSI
|
||||
ReactAndroid::reactnative # <-- RN: React Native JNI bindings (RN 0.76+)
|
||||
fbjni::fbjni # <-- fbjni
|
||||
GLESv2 # <-- OpenGL (for VideoPipeline)
|
||||
EGL # <-- OpenGL (EGL) (for VideoPipeline)
|
||||
${LOG_LIB} # <-- Logcat logger
|
||||
android # <-- Android JNI core
|
||||
ReactAndroid::jsi # <-- RN: JSI
|
||||
# ReactAndroid::reactnativejni # <-- Temporarily disabled for RN 0.79+ compatibility
|
||||
fbjni::fbjni # <-- fbjni
|
||||
GLESv2 # <-- OpenGL (for VideoPipeline)
|
||||
EGL # <-- OpenGL (EGL) (for VideoPipeline)
|
||||
)
|
||||
|
||||
# Optionally also add Frame Processors here
|
||||
|
||||
@@ -133,16 +133,8 @@ android {
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
freeCompilerArgs += [
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=com.facebook.react.annotations.UnstableReactNativeAPI"
|
||||
]
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
@@ -165,7 +157,6 @@ android {
|
||||
"**/libhermes-executor-debug.so",
|
||||
"**/libhermes_executor.so",
|
||||
"**/libreactnativejni.so",
|
||||
"**/libreactnative.so",
|
||||
"**/libturbomodulejsijni.so",
|
||||
"**/libreact_nativemodule_core.so",
|
||||
"**/libjscexecutor.so"
|
||||
|
||||
@@ -32,7 +32,7 @@ class CameraViewManager : ViewGroupManager<CameraView>() {
|
||||
.put("cameraError", MapBuilder.of("registrationName", "onError"))
|
||||
.put("cameraCodeScanned", MapBuilder.of("registrationName", "onCodeScanned"))
|
||||
.put("onVideoChunkReady", MapBuilder.of("registrationName", "onVideoChunkReady"))
|
||||
.build()?.toMutableMap()
|
||||
.build()
|
||||
|
||||
override fun getName(): String = TAG
|
||||
|
||||
|
||||
@@ -29,10 +29,14 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase
|
||||
var sharedRequestCode = 10
|
||||
|
||||
init {
|
||||
// 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")
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,11 +73,15 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase
|
||||
}
|
||||
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
fun takePhoto(viewTag: Int, options: ReadableMap, promise: Promise) {
|
||||
@@ -149,7 +157,7 @@ class CameraViewModule(reactContext: ReactApplicationContext) : ReactContextBase
|
||||
}
|
||||
|
||||
private fun canRequestPermission(permission: String): Boolean {
|
||||
val activity = reactApplicationContext.currentActivity as? PermissionAwareActivity
|
||||
val activity = currentActivity as? PermissionAwareActivity
|
||||
return activity?.shouldShowRequestPermissionRationale(permission) ?: false
|
||||
}
|
||||
|
||||
|
||||
@@ -78,9 +78,6 @@ class VisionCameraProxy(private val reactContext: ReactApplicationContext) {
|
||||
FrameProcessorPluginRegistry.getPlugin(name, this, options)
|
||||
|
||||
// private C++ funcs
|
||||
// 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
|
||||
// Commented out due to React Native 0.79+ API compatibility issues
|
||||
// private external fun initHybrid(jsContext: Long, jsCallInvokerHolder: CallInvokerHolderImpl, scheduler: VisionCameraScheduler): HybridData
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user