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

Execution failed for task ':react-native-vision-camera:externalNativeBuildDebug' 🐛 #609

Closed
3 of 4 tasks
sijav opened this issue Nov 23, 2021 · 5 comments · Fixed by #610
Closed
3 of 4 tasks

Execution failed for task ':react-native-vision-camera:externalNativeBuildDebug' 🐛 #609

sijav opened this issue Nov 23, 2021 · 5 comments · Fixed by #610
Labels
🐛 bug Something isn't working

Comments

@sijav
Copy link

sijav commented Nov 23, 2021

What were you trying to do?

I can't build for debug

Reproduceable Code

No response

What happened instead?

I'm getting the folowing errors:
error: redefinition of 'JHashMap'
error: redefinition of 'create'

Relevant log output

Build VisionCamera_armeabi-v7a
ninja: Entering directory `C:\Some\Path\Here\ReactNativeProject\node_modules\react-native-vision-camera\android\.cxx\cmake\debug\armeabi-v7a'
In file included from ../../../../src/main/cpp/java-bindings/JHashMap.cpp:5:
../../../../src/main/cpp/java-bindings/JHashMap.h:16:8: error: redefinition of 'JHashMap'
../../../../build/fbjni-0.3.0-headers.jar\fbjni/detail/Iterator.h:170:8: note: previous definition is here
../../../../src/main/cpp/java-bindings/JHashMap.cpp:15:43: error: redefinition of 'create'
../../../../build/fbjni-0.3.0-headers.jar\fbjni/detail/Iterator-inl.h:230:42: note: previous definition is here
In file included from ../../../../src/main/cpp/JSIJNIConversion.cpp:25:
../../../../src/main/cpp/java-bindings/JHashMap.h:16:8: error: redefinition of 'JHashMap'
../../../../build/fbjni-0.3.0-headers.jar\fbjni/detail/Iterator.h:170:8: note: previous definition is here

Device

Xiaomi K20Pro

VisionCamera Version

2.9.3

Additional information

@sijav sijav added the 🐛 bug Something isn't working label Nov 23, 2021
@Baer05
Copy link

Baer05 commented Nov 23, 2021

same problem -.-

@timh1004
Copy link

timh1004 commented Nov 23, 2021

I also have this exact issue! A week ago it was working properly.
It was working until I did a ./gradlew clean.

@sijav
Copy link
Author

sijav commented Nov 23, 2021

I guess it's because of the new fbjni module that added JHashMap in the new version perhaps?
I'll try to remove them and see if it resolve anything

@sijav
Copy link
Author

sijav commented Nov 23, 2021

yup worked:
remove both JHashMap.h and JHashMap.cpp from node_modules/react-native-vision-camera/android/src/main/cpp/java-binding
from node_modules/react-native-vision-camera/android/src/main/cpp/JSIJNIConversion.cpp remove the following line 25:
#include "java-bindings/JHashMap.h"
from node_modules/react-native-vision-camera/android/CMakeLists.txt remove the following line 24:
src/main/cpp/java-bindings/JHashMap.cpp
looking forward for a fix

@mrousavy
Copy link
Owner

I guess it's because of the new fbjni module that added JHashMap in the new version perhaps?

yes, I waited until they released a new version with that. I'll remove mine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
4 participants