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

error building on windows due to long paths #2122

Closed
aleluiah opened this issue Jul 11, 2022 · 9 comments
Closed

error building on windows due to long paths #2122

aleluiah opened this issue Jul 11, 2022 · 9 comments

Comments

@aleluiah
Copy link

Task :react-native-gesture-handler:buildNdkBuildDebug[arm64-v8a][rngesturehandler_modules]
C/C++: C:/android-ndk-r21e/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin\ld: cannot find C:\Cliqueon\node_modules\react-native-gesture-handler\android\build\intermediates\cxx\Debug\3x5p2864/obj/local/arm64-v8a/objs-debug/rngesturehandler_modules/C_/Cliqueon/node_modules/react-native-gesture-handler/android/src/main/jni/RNGestureHandlerComponentsRegistry.o: No such file or directory
C/C++: clang++: error: linker command failed with exit code 1 (use -v to see invocation)
C/C++: make: *** [C:/android-ndk-r21e/build//../build/core/build-binary.mk:725: C:\Cliqueon\node_modules\react-native-gesture-handler\android\build\intermediates\cxx\Debug\3x5p2864/obj/local/arm64-v8a/librngesturehandler_modules.so] Error

@github-actions
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snippet of code, a snack or a link to a GitHub repository that reproduces the problem?

@github-actions
Copy link

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Description, Platforms, Steps To Reproduce, Snack or minimal code example and Package versions sections.

@aleluiah
Copy link
Author

check out Fix building RN with new architecture on Windows boxes by using relative paths for C++ sources
facebook/react-native#33784
this technique was used for react native to fix long path limitation on windows

@j-piasecki
Copy link
Member

Hi @aleluiah, could you check if the above PR solves the issue for you?

@psycheangel
Copy link

@j-piasecki
Hi, I tried to add NDK_APP_SHORT_COMMANDS to android/build.gradle as you suggested in PR, it still resulted with same behavior with current issue.

then I tried solution like in react-native PR #33784
it solved the problem

LOCAL_C_INCLUDES := $(LOCAL_PATH) $(GENERATED_SRC_DIR)/codegen/jni
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)
LOCAL_SRC_FILES := $(subst $(LOCAL_PATH)/,,$(LOCAL_SRC_FILES))
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(GENERATED_SRC_DIR)/codegen/jni

@github-actions
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@j-piasecki
Copy link
Member

Great that you solved the problem! In the meantime, we've replaced NDK with CMake in the Gesture Handler 2.6.0. It would be great if you could check if it works for you out of the box.

@psycheangel
Copy link

Great that you solved the problem! In the meantime, we've replaced NDK with CMake in the Gesture Handler 2.6.0. It would be great if you could check if it works for you out of the box.

Yes, its working without long-path issue in windows

@j-piasecki
Copy link
Member

Great! In that case I believe the issue is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants