react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

error building on windows due to long paths

Open aleluiah opened this issue 3 years ago • 4 comments

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

aleluiah avatar Jul 11 '22 19:07 aleluiah

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[bot] avatar Jul 11 '22 19:07 github-actions[bot]

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.

github-actions[bot] avatar Jul 11 '22 19:07 github-actions[bot]

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

aleluiah avatar Jul 11 '22 19:07 aleluiah

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

j-piasecki avatar Aug 05 '22 10:08 j-piasecki

@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

psycheangel avatar Aug 23 '22 18:08 psycheangel

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?

github-actions[bot] avatar Aug 23 '22 18:08 github-actions[bot]

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.

j-piasecki avatar Sep 05 '22 09:09 j-piasecki

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

psycheangel avatar Sep 06 '22 01:09 psycheangel

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

j-piasecki avatar Sep 06 '22 09:09 j-piasecki