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

Error building using rn v0.68.2 on Windows machine

Open ralppppy opened this issue 3 years ago • 6 comments

Description

Error in building using latest version of react-native-gesture-handler and react-native, `FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':react-native-gesture-handler:buildNdkBuildDebug[rngesturehandler_modules]'.

Build command failed. Error while executing process C:\Users\ralppppy\AppData\Local\Android\Sdk\ndk\21.4.7075529\ndk-build.cmd with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\orgkomeph\node_modules\react-native-gesture-handler\android\src\main\jni\Android.mk APP_ABI=armeabi-v7a NDK_ALL_ABIS=armeabi-v7a NDK_DEBUG=1 NDK_OUT=C:\orgkomeph\node_modules\react-native-gesture-handler\android\build\intermediates\cxx\Debug\6px4e409/obj NDK_LIBS_OUT=C:\orgkomeph\node_modules\react-native-gesture-handler\android\build\intermediates\cxx\Debug\6px4e409/lib APP_CFLAGS+=-Wall APP_CFLAGS+=-Werror APP_CFLAGS+=-fexceptions APP_CFLAGS+=-frtti APP_CFLAGS+=-DWITH_INSPECTOR=1 APP_CPPFLAGS+=-std=c++17 APP_PLATFORM=android-21 APP_STL=c++_shared NDK_TOOLCHAIN_VERSION=clang GENERATED_SRC_DIR=C:\orgkomeph\android\app\build/generated/source PROJECT_BUILD_DIR=C:\orgkomeph\android\app\build REACT_ANDROID_DIR=C:\orgkomeph\node_modules\react-native/ReactAndroid REACT_ANDROID_BUILD_DIR=C:\orgkomeph\node_modules\react-native/ReactAndroid/build rngesturehandler_modules} [armeabi-v7a] Compile++ thumb: rngesturehandler_modules <= RNGestureHandlerComponentsRegistry.cpp [armeabi-v7a] Compile++ thumb: rngesturehandler_modules <= OnLoad.cpp [armeabi-v7a] Compile++ thumb: rngesturehandler_modules <= cpp-adapter.cpp [armeabi-v7a] Prebuilt : libjsi.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libfbjni.so <= C:/orgkomeph/node_modules/react-native/ReactAndroid/src/main/jni/first-party/fbjni/jni/armeabi-v7a/ [armeabi-v7a] Prebuilt : libglog.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libfolly_json.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libyoga.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libreact_nativemodule_core.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libturbomodulejsijni.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : librrc_view.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libreact_render_core.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libreact_render_graphics.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libfabricjni.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libfolly_futures.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libreact_debug.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libreact_render_componentregistry.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libreact_render_debug.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libruntimeexecutor.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libreact_render_mapbuffer.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libreact_render_uimanager.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Prebuilt : libreact_codegen_rncore.so <= C:\orgkomeph\android\app\build/react-ndk/exported/armeabi-v7a/ [armeabi-v7a] Compile++ thumb: react_codegen_rngesturehandler <= rngesturehandler-generated.cpp [armeabi-v7a] Compile++ thumb: react_codegen_rngesturehandler <= EventEmitters.cpp [armeabi-v7a] Compile++ thumb: react_codegen_rngesturehandler <= ShadowNodes.cpp [armeabi-v7a] Compile++ thumb: react_codegen_rngesturehandler <= Props.cpp [armeabi-v7a] Prebuilt : libc++_shared.so <= <NDK>/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/ [armeabi-v7a] SharedLibrary : libreact_codegen_rngesturehandler.so [armeabi-v7a] SharedLibrary : librngesturehandler_modules.so

C:/Users/ralppppy/AppData/Local/Android/Sdk/ndk/21.4.7075529/build//../toolchains/llvm/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: error: cannot open C:\orgkomeph\node_modules\react-native-gesture-handler\android\build\intermediates\cxx\Debug\6px4e409/obj/local/armeabi-v7a/objs-debug/rngesturehandler_modules/C_/orgkomeph/node_modules/react-native-gesture-handler/android/src/main/jni/RNGestureHandlerComponentsRegistry.o: No such file or directory C:/orgkomeph/node_modules/react-native-gesture-handler/android/src/main/jni/OnLoad.cpp:7: error: undefined reference to 'facebook::react::RNGestureHandlerComponentsRegistry::registerNatives()' clang++: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [C:/Users/ralppppy/AppData/Local/Android/Sdk/ndk/21.4.7075529/build//../build/core/build-binary.mk:725: C:\orgkomeph\node_modules\react-native-gesture-handler\android\build\intermediates\cxx\Debug\6px4e409/obj/local/armeabi-v7a/librngesturehandler_modules.so] Error 1 `

Platforms

  • [ ] iOS
  • [X] Android
  • [ ] Web

Screenshots

Steps To Reproduce

  1. Install react native v0.68.2
  2. Install latest react-native-gesture-handler
  3. Change newArchEnabled=true in gradlew.properties
  4. run, npm run android

Expected behavior

Succesfull build

Actual behavior

Build failed

Snack or minimal code example

Package versions

  • React: 17.0.2
  • React Native: 0.68.2
  • React Native Gesture Handler: 2.4.2

ralppppy avatar May 11 '22 03:05 ralppppy

Hey! 👋

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

Please complete Snack or minimal code example section.

github-actions[bot] avatar May 11 '22 03:05 github-actions[bot]

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 May 11 '22 03:05 github-actions[bot]

Hi! Unfortunately I don't have a Windows setup for React Native (or Android) development at the moment, so I don't think I'll be able to help much with build issues 😞. Trying to use NDK 23 may help, but that's a shot in the dark based on commit history of React Native.

j-piasecki avatar May 13 '22 17:05 j-piasecki

Hi! @ralppppy I have same problem. I've tried NDK 21, 23, 24 and this doesn't fix. Did you solved this?

sashansk3 avatar May 25 '22 11:05 sashansk3

@sashansk3 No I haven't, But I believe this problem was already solved by the react-native team. I hope both parties will communicate to solve this issue because this package is really important.

ralppppy avatar May 26 '22 00:05 ralppppy

Hi, this problem still occurs with react-native 0.69.1 on Windows machine

psycheangel avatar Jul 06 '22 02:07 psycheangel

In Gesture Handler 2.6.0 NDK has been replaced with CMake, which should solve the issue. I'll close it and if it still affects you, please let me know.

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