Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] enable new arch #3244

Closed

Conversation

hannojg
Copy link
Collaborator

@hannojg hannojg commented Oct 15, 2024

What

Changes

Tested on

Related issues

Copy link

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-vision-camera ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 16, 2024 3:59pm

@hannojg hannojg changed the title enable new arch [WIP enable new arch Oct 15, 2024
@hannojg hannojg changed the title [WIP enable new arch [WIP] enable new arch Oct 15, 2024
@mysport12
Copy link

Hi @hannojg,

I saw you already had this PR in progress and thought it might be easier to offer up a change needed for 0.76.0/new arch support since it modifies the CMakeLists.txt file which you are modifying here (in the spirit of reducing conflicts). Here is the patch I am running for 0.76.0. The conditional is one being applied by other libraries (https://github.com/Shopify/react-native-skia/pull/2694/files). The flag provided by RN is still not working even in 0.76.0-rc.5 but you can see the discussion regarding it here (react-native-community/discussions-and-proposals#816)

index 1460dbd7729f1375852876f13af0e89c46c1382e..75b5d742ad754fc1b4ced77840ade71098ba1e84 100644
--- a/android/CMakeLists.txt
+++ b/android/CMakeLists.txt
@@ -54,15 +54,29 @@ target_include_directories(
         "${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni/react/turbomodule" # <-- CallInvokerHolder JNI wrapper
 )
 
-# Link everything together
-target_link_libraries(
-        ${PACKAGE_NAME}
-        ${LOG_LIB}                          # <-- Logcat logger
-        android                             # <-- Android JNI core
-        ReactAndroid::jsi                   # <-- RN: JSI
-        ReactAndroid::reactnativejni        # <-- RN: React Native JNI bindings
-        fbjni::fbjni                        # <-- fbjni
-)
+
+
+# This if-then-else can be removed once this library does not support version below 0.76
+if (ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
+        target_link_libraries(
+                ${PACKAGE_NAME}
+                ${LOG_LIB}
+                android
+                ReactAndroid::reactnative
+                ReactAndroid::jsi
+                fbjni::fbjni
+        )
+else()
+        # Link everything together
+        target_link_libraries(
+                ${PACKAGE_NAME}
+                ${LOG_LIB}                          # <-- Logcat logger
+                android                             # <-- Android JNI core
+                ReactAndroid::jsi                   # <-- RN: JSI
+                ReactAndroid::reactnativejni        # <-- RN: React Native JNI bindings
+                fbjni::fbjni                        # <-- fbjni
+        )
+endif()
 
 # Optionally also add Frame Processors here
 message("VisionCamera: Frame Processors: ${ENABLE_FRAME_PROCESSORS}!")```

@mysport12
Copy link

If you'd prefer a separate PR I can certainly go that route. Just let me know.

@hannojg
Copy link
Collaborator Author

hannojg commented Oct 17, 2024

Thanks for bringing this to my attention I will consider this!

@hannojg
Copy link
Collaborator Author

hannojg commented Oct 17, 2024

actually i'll close this PR for this one, but i'll keep your comments in mind.

@hannojg hannojg closed this Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants