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

Android release build issue when apk and test apk built together in a single command #4588

Open
2 tasks done
jayshah123 opened this issue Sep 23, 2024 · 0 comments
Open
2 tasks done

Comments

@jayshah123
Copy link

jayshah123 commented Sep 23, 2024

What happened?

I am running a android release build as mentioned in the docs & it erros out (error mentioned below):

    'android.release': {
      type: 'android.apk',
      build: 'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',
      binaryPath: 'android/app/build/outputs/apk/release/app-release.apk'
    },

Where I get this error:

  CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the CMake files:
  HERMES_EXECUTOR_LIB
      linked by target "reanimated" in directory /myapp/src/node_modules/react-native-reanimated/android

I run into build errors with above, but when run separately, it works fine:

./gradlew assembleRelease && ./gradlew assembleAndroidTest -DtestBuildType=release

It seems like in the first case, it picks up debug type

What was the expected behaviour?

No build error should happen

Was it tested on latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test throw out a timeout?

Help us reproduce this issue!

This happens on build itself, I get a reanimated error:

  CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the CMake files:
  HERMES_EXECUTOR_LIB
      linked by target "reanimated" in directory /myapp/src/node_modules/react-native-reanimated/android

and also:

In what environment did this happen?

Detox version: [email protected]
React Native version: RN 70
Has Fabric (React Native's new rendering system) enabled: (yes/no) no
Node version: 18.x
Device model: x
Android version: x
Test-runner (select one): jest

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
-----------
* What went wrong:
Execution failed for task ':react-native-reanimated:buildCMakeDebug[arm64-v8a]'.
> Build command failed.
  Error while executing process /Users/jshah/Library/Android/sdk/cmake/3.18.1/bin/ninja with arguments {-C /Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/android/.cxx/Debug/5o3d4556/arm64-v8a reanimated}
  ninja: Entering directory `/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/android/.cxx/Debug/5o3d4556/arm64-v8a'
  [0/2] Re-checking globbed directories...
  [1/7] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/LayoutAnimations.cpp.o
  [2/7] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/AndroidUIScheduler.cpp.o
  [3/7] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o
  [4/7] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/OnLoad.cpp.o
  [5/7] Building CXX object CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModule.cpp.o
  [6/7] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/NativeProxy.cpp.o
  [7/7] Linking CXX shared library ../../../../build/intermediates/cxx/Debug/5o3d4556/obj/arm64-v8a/libreanimated.so
  FAILED: ../../../../build/intermediates/cxx/Debug/5o3d4556/obj/arm64-v8a/libreanimated.so 
  : && /Users/jshah/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android26 --sysroot=/Users/jshah/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DREACT_NATIVE_MINOR_VERSION=70 -DREANIMATED_VERSION=3.7.0 -DHERMES_ENABLE_DEBUGGER=1 -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all -std=c++17 -Wall -Werror -DJS_RUNTIME_HERMES=1 -fno-limit-debug-info  -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libreanimated.so -o ../../../../build/intermediates/cxx/Debug/5o3d4556/obj/arm64-v8a/libreanimated.so CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Fabric/PropsRegistry.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Fabric/ReanimatedCommitHook.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Fabric/ReanimatedCommitMarker.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Fabric/ReanimatedMountHook.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Fabric/ShadowTreeCloner.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModule.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedRuntime.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeRegistry.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Registries/EventHandlerRegistry.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/SharedItems/Shareables.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/AsyncQueue.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/FeaturesConfig.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/JSISerializer.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/JSLogger.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/JSScheduler.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/ReanimatedJSIUtils.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/ReanimatedVersion.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/UIRuntimeDecorator.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/UIScheduler.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/WorkletEventHandler.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/AndroidLogger.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/AndroidUIScheduler.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/LayoutAnimations.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/NativeProxy.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/OnLoad.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/TurboModule.cpp.o -L/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native/ReactAndroid/src/main/jni/first-party/react/jni/arm64-v8a   -L/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/android/build/third-party-ndk/hermes/jni/arm64-v8a -llog  -landroid  -ljsi  -lglog  -lfbjni  -lfolly_runtime  -lreactnativejni  -lhermes  -lhermes-executor-debug  -latomic -lm && :
  ld: error: undefined symbol: facebook::hermes::HermesRuntime::getDebugger()
  >>> referenced by ReanimatedHermesRuntime.cpp:58 (/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp:58)
  >>>               CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp.o:(reanimated::HermesExecutorRuntimeAdapter::getDebugger())

More data, please!

I see following logs for ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release

-----------
* What went wrong:
Execution failed for task ':react-native-reanimated:buildCMakeDebug[arm64-v8a]'.
> Build command failed.
  Error while executing process /Users/jshah/Library/Android/sdk/cmake/3.18.1/bin/ninja with arguments {-C /Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/android/.cxx/Debug/5o3d4556/arm64-v8a reanimated}
  ninja: Entering directory `/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/android/.cxx/Debug/5o3d4556/arm64-v8a'
  [0/2] Re-checking globbed directories...
  [1/7] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/LayoutAnimations.cpp.o
  [2/7] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/AndroidUIScheduler.cpp.o
  [3/7] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o
  [4/7] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/OnLoad.cpp.o
  [5/7] Building CXX object CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModule.cpp.o
  [6/7] Building CXX object CMakeFiles/reanimated.dir/src/main/cpp/NativeProxy.cpp.o
  [7/7] Linking CXX shared library ../../../../build/intermediates/cxx/Debug/5o3d4556/obj/arm64-v8a/libreanimated.so
  FAILED: ../../../../build/intermediates/cxx/Debug/5o3d4556/obj/arm64-v8a/libreanimated.so 
  : && /Users/jshah/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android26 --sysroot=/Users/jshah/Library/Android/sdk/ndk/24.0.8215888/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DREACT_NATIVE_MINOR_VERSION=70 -DREANIMATED_VERSION=3.7.0 -DHERMES_ENABLE_DEBUGGER=1 -fexceptions -fno-omit-frame-pointer -frtti -fstack-protector-all -std=c++17 -Wall -Werror -DJS_RUNTIME_HERMES=1 -fno-limit-debug-info  -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -shared -Wl,-soname,libreanimated.so -o ../../../../build/intermediates/cxx/Debug/5o3d4556/obj/arm64-v8a/libreanimated.so CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/AnimatedSensor/AnimatedSensorModule.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Fabric/PropsRegistry.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Fabric/ReanimatedCommitHook.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Fabric/ReanimatedCommitMarker.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Fabric/ReanimatedMountHook.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Fabric/ShadowTreeCloner.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/LayoutAnimations/LayoutAnimationsManager.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModule.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/NativeModules/NativeReanimatedModuleSpec.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedRuntime.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeRegistry.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Registries/EventHandlerRegistry.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/SharedItems/Shareables.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/AsyncQueue.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/FeaturesConfig.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/JSISerializer.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/JSLogger.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/JSScheduler.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/ReanimatedJSIUtils.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/ReanimatedVersion.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/UIRuntimeDecorator.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/UIScheduler.cpp.o CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/Tools/WorkletEventHandler.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/AndroidLogger.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/AndroidUIScheduler.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/JNIHelper.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/LayoutAnimations.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/NativeProxy.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/OnLoad.cpp.o CMakeFiles/reanimated.dir/src/main/cpp/TurboModule.cpp.o -L/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native/ReactAndroid/src/main/jni/first-party/react/jni/arm64-v8a   -L/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/android/build/third-party-ndk/hermes/jni/arm64-v8a -llog  -landroid  -ljsi  -lglog  -lfbjni  -lfolly_runtime  -lreactnativejni  -lhermes  -lhermes-executor-debug  -latomic -lm && :
  ld: error: undefined symbol: facebook::hermes::HermesRuntime::getDebugger()
  >>> referenced by ReanimatedHermesRuntime.cpp:58 (/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp:58)
  >>>               CMakeFiles/reanimated.dir/Users/jshah/workstuff/my-app-example-clock/node_modules/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp.o:(reanimated::HermesExecutorRuntimeAdapter::getDebugger())

@jayshah123 jayshah123 changed the title Android release build issue when apk and test apk build together in a single command Android release build issue when apk and test apk built together in a single command Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant