react-native-community / cli

The React Native Community CLI - command line tools to help you build RN apps
MIT License
2.4k stars 904 forks source link

Undeclared identifer in OnLoad.cpp.o #2380

Closed ja-bravo closed 2 months ago

ja-bravo commented 6 months ago

Environment

info Fetching system and libraries information...
System:
  OS: macOS 14.1.1
  CPU: (8) arm64 Apple M1
  Memory: 109.25 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.18.2
    path: ~/.nvm/versions/node/v18.18.2/bin/node
  Yarn:
    version: 1.22.22
    path: ~/Desktop/projects/digital-wallet/src/apps/project-name/node_modules/.bin/yarn
  npm:
    version: 9.8.1
    path: ~/.nvm/versions/node/v18.18.2/bin/npm
  Watchman:
    version: 2023.12.04.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.13.0
    path: /Users/josebravo/.rvm/gems/ruby-3.3.0/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK:
    API Levels:
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.2
      - 34.0.0
    System Images:
      - android-33 | Google APIs ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10811636
  Xcode:
    version: 15.0.1/15A507
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 3.3.0
    path: /Users/josebravo/.rvm/rubies/ruby-3.3.0/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: "*"
  react-native:
    installed: 0.74.1
    wanted: "*"
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Description

When building an Android app using the new architecture, there's an error on the generated cpp files. I've tried cleaning gradle and reinstalling node_modules but nothing worked.

The app is inside a NX monorepo.

[39/90] Building CXX object CMakeFiles/appmodules.dir/OnLoad.cpp.o
  FAILED: CMakeFiles/appmodules.dir/OnLoad.cpp.o
  /Users/josebravo/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --sysroot=/Users/josebravo/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Dappmodules_EXPORTS -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/android/app/build/generated/rncli/src/main/jni -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-svg/android/src/main/jni -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-safe-area-context/android/src/main/jni -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-screens/android/src/main/jni -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-svg/android/src/main/jni/. -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-svg/android/src/main/jni/../../../../common/cpp -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-svg/android/src/main/jni/../../../build/generated/source/codegen/jni -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-svg/android/src/main/jni/../../../build/generated/source/codegen/jni/react/renderer/components/rnsvg -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-reanimated/android/build/generated/source/codegen/jni/. -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-reanimated/android/build/generated/source/codegen/jni/react/renderer/components/rnreanimated -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-gesture-handler/android/build/generated/source/codegen/jni/. -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-gesture-handler/android/build/generated/source/codegen/jni/react/renderer/components/rngesturehandler_codegen -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-safe-area-context/android/src/main/jni/. -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-safe-area-context/android/src/main/jni/../../../../common/cpp -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-safe-area-context/android/src/main/jni/../../../build/generated/source/codegen/jni -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-safe-area-context/android/src/main/jni/../../../build/generated/source/codegen/jni/react/renderer/components/safeareacontext -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-screens/android/src/main/jni/. -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-screens/android/src/main/jni/../../../../common/cpp -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-screens/android/src/main/jni/../../../build/generated/source/codegen/jni -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-screens/android/src/main/jni/../../../build/generated/source/codegen/jni/react/renderer/components/rnscreens -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-pager-view/android/build/generated/source/codegen/jni/. -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-pager-view/android/build/generated/source/codegen/jni/react/renderer/components/RNCViewPager -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-mmkv/android/build/generated/source/codegen/jni/. -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-mmkv/android/build/generated/source/codegen/jni/react/renderer/components/RNMmkvSpec -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-permissions/android/build/generated/source/codegen/jni/. -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-permissions/android/build/generated/source/codegen/jni/react/renderer/components/rnpermissions -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-bootsplash/android/build/generated/source/codegen/jni/. -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native-bootsplash/android/build/generated/source/codegen/jni/react/renderer/components/RNBootSplashSpec -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/@sentry/react-native/android/build/generated/source/codegen/jni/. -I/Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/@sentry/react-native/android/build/generated/source/codegen/jni/react/renderer/components/RNSentrySpec -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/fabricjni/include -isystem /Users/josebravo/.gradle/caches/transforms-4/6229cd9d3a76b717a83fc82461ba1d49/transformed/jetified-fbjni-0.6.0/prefab/modules/fbjni/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/folly_runtime/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/glog/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/jsi/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_codegen_rncore/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_debug/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_utils/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_nativemodule_core/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_newarchdefaults/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_cxxreactpackage/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_componentregistry/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_core/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_debug/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_graphics/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_imagemanager/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_mapbuffer/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_textlayoutmanager/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/rrc_image/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/rrc_view/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/rrc_text/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/rrc_textinput/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/rrc_legacyviewmanagerinterop/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/runtimeexecutor/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/turbomodulejsijni/include -isystem /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/yoga/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security   -fno-limit-debug-info  -fPIC -Wall -Werror -Wno-error=cpp -fexceptions -frtti -std=c++20 -DLOG_TAG=\"ReactNative\" -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DFOLLY_HAVE_XSI_STRERROR_R=1 -MD -MT CMakeFiles/appmodules.dir/OnLoad.cpp.o -MF CMakeFiles/appmodules.dir/OnLoad.cpp.o.d -o CMakeFiles/appmodules.dir/OnLoad.cpp.o -c /Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp
  /Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:74:10: error: use of undeclared identifier 'rncli_cxxModuleProvider'; did you mean 'rncli_ModuleProvider'?
    return rncli_cxxModuleProvider(name, jsInvoker);
           ^~~~~~~~~~~~~~~~~~~~~~~
           rncli_ModuleProvider
  /Users/josebravo/Desktop/projects/project-name/src/apps/project-name/android/app/build/generated/rncli/src/main/jni/rncli.h:19:30: note: 'rncli_ModuleProvider' declared here
  std::shared_ptr<TurboModule> rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params);
                               ^
  /Users/josebravo/Desktop/projects/project-name/src/apps/project-name/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:74:40: error: no viable conversion from 'const std::shared_ptr<CallInvoker>' to 'const JavaTurboModule::InitParams'
    return rncli_cxxModuleProvider(name, jsInvoker);
                                         ^~~~~~~~~
  /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_nativemodule_core/include/ReactCommon/JavaTurboModule.h:28:10: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const std::shared_ptr<CallInvoker>' to 'const InitParams &' for 1st argument
    struct InitParams {
           ^
  /Users/josebravo/.gradle/caches/transforms-4/dbe0fabdf0c377d1f9167c17febeb962/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_nativemodule_core/include/ReactCommon/JavaTurboModule.h:28:10: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const std::shared_ptr<CallInvoker>' to 'InitParams &&' for 1st argument
  /Users/josebravo/Desktop/projects/project-name/src/apps/project-name/android/app/build/generated/rncli/src/main/jni/rncli.h:19:116: note: passing argument to parameter 'params' here
  std::shared_ptr<TurboModule> rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params);
miinos commented 6 months ago

same problem on android build with new architecture

szymonrybczak commented 6 months ago

cc @cortinico

cortinico commented 6 months ago

that happens when the version of React Native and the CLI are not aligned. Can you share which version of @react-native-community/cli-platform-android you folks have installed?

miinos commented 5 months ago

Fixed the issue by adding to the package.json file:


"resolutions": {
    "@react-native-community/cli": "13.6.6",
    "@react-native-community/cli-clean": "13.6.6",
    "@react-native-community/cli-config": "13.6.6",
    "@react-native-community/cli-debugger-ui": "13.6.6",
    "@react-native-community/cli-doctor": "13.6.6",
    "@react-native-community/cli-hermes": "13.6.6",
    "@react-native-community/cli-platform-android": "13.6.6",
    "@react-native-community/cli-platform-ios": "13.6.6",
    "@react-native-community/cli-server-api": "13.6.6",
    "@react-native-community/cli-tools": "13.6.6",
    "@react-native-community/cli-types": "13.6.6"
  }
szymonrybczak commented 5 months ago

hey @miinos I'm glat that it works for you, however adding resolutions field is not recommended way. If you don't override - what's the version of CLI that you have in project? You can check it by running:

yarn why @react-native-community/cli
miinos commented 5 months ago

hey @miinos I'm glat that it works for you, however adding resolutions field is not recommended way. If you don't override - what's the version of CLI that you have in project? You can check it by running:

yarn why @react-native-community/cli

without resolutions:

├─ react-native@npm:0.73.6
│  └─ @react-native-community/cli@npm:12.3.6 (via npm:12.3.6)
│
├─ react-native@npm:0.74.1
│  └─ @react-native-community/cli@npm:13.6.6 (via npm:13.6.6)
│
├─ react-native@npm:0.74.1 [51e67]
│  └─ @react-native-community/cli@npm:13.6.6 (via npm:13.6.6)
│
└─ react-native@npm:0.73.6 [eb6a2]
   └─ @react-native-community/cli@npm:12.3.6 (via npm:12.3.6)

with resolutions


├─ react-native@npm:0.73.6
│  └─ @react-native-community/cli@npm:13.6.6 (via npm:13.6.6)
│
├─ react-native@npm:0.74.1
│  └─ @react-native-community/cli@npm:13.6.6 (via npm:13.6.6)
│
├─ react-native@npm:0.74.1 [51e67]
│  └─ @react-native-community/cli@npm:13.6.6 (via npm:13.6.6)
│
└─ react-native@npm:0.73.6 [eb6a2]
   └─ @react-native-community/cli@npm:13.6.6 (via npm:13.6.6)
cortinico commented 5 months ago

Looks like you're having different versions of react-native in your projects (that's most likely the root cause of your issue). Why is that the case?

miinos commented 5 months ago

Looks like you're having different versions of react-native in your projects (that's most likely the root cause of your issue). Why is that the case?

In my package.json, I'm only using the latest version of react-native: 0.74.1

szymonrybczak commented 5 months ago

@miinos can you share a repro then, where we can reproduce this issue?

tonypangs commented 5 months ago

i got the same error here too with latest version - react native: 0.74.1

Task :app:buildCMakeDebug[arm64-v8a] C/C++: ninja: Entering directory `/Users/Workspace/xx/android/app/.cxx/Debug/h1j1a4m5/arm64-v8a' C/C++: /Users/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --sysroot=/Users/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Dappmodules_EXPORTS -I/Users/Workspace/xx/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup -I/Users/Workspace/xx/android/app/build/generated/rncli/src/main/jni -I/Users/Workspace/xx/node_modules/react-native-safe-area-context/android/src/main/jni -I/Users/Workspace/xx/node_modules/react-native-screens/android/src/main/jni -I/Users/Workspace/xx/node_modules/react-native-svg/android/src/main/jni -I/Users/Workspace/xx/node_modules/@shopify/react-native-skia/android/build/generated/source/codegen/jni/. -I/Users/Workspace/xx/node_modules/@shopify/react-native-skia/android/build/generated/source/codegen/jni/react/renderer/components/rnskia -I/Users/Workspace/xx/node_modules/react-native-date-picker/android/build/generated/source/codegen/jni/. -I/Users/Workspace/xx/node_modules/react-native-date-picker/android/build/generated/source/codegen/jni/react/renderer/components/RNDatePickerSpecs -I/Users/Workspace/xx/node_modules/react-native-gesture-handler/android/build/generated/source/codegen/jni/. -I/Users/Workspace/xx/node_modules/react-native-gesture-handler/android/build/generated/source/codegen/jni/react/renderer/components/rngesturehandler_codegen -I/Users/Workspace/xx/node_modules/react-native-mmkv/android/build/generated/source/codegen/jni/. -I/Users/Workspace/xx/node_modules/react-native-mmkv/android/build/generated/source/codegen/jni/react/renderer/components/reactnativemmkv -I/Users/Workspace/xx/node_modules/react-native-reanimated/android/build/generated/source/codegen/jni/. -I/Users/Workspace/xx/node_modules/react-native-reanimated/android/build/generated/source/codegen/jni/react/renderer/components/rnreanimated -I/Users/Workspace/xx/node_modules/react-native-safe-area-context/android/src/main/jni/. -I/Users/Workspace/xx/node_modules/react-native-safe-area-context/android/src/main/jni/../../../../common/cpp -I/Users/Workspace/xx/node_modules/react-native-safe-area-context/android/src/main/jni/../../../build/generated/source/codegen/jni -I/Users/Workspace/xx/node_modules/react-native-safe-area-context/android/src/main/jni/../../../build/generated/source/codegen/jni/react/renderer/components/safeareacontext -I/Users/Workspace/xx/node_modules/react-native-screens/android/src/main/jni/. -I/Users/Workspace/xx/node_modules/react-native-screens/android/src/main/jni/../../../../common/cpp -I/Users/Workspace/xx/node_modules/react-native-screens/android/src/main/jni/../../../build/generated/source/codegen/jni -I/Users/Workspace/xx/node_modules/react-native-screens/android/src/main/jni/../../../build/generated/source/codegen/jni/react/renderer/components/rnscreens -I/Users/Workspace/xx/node_modules/react-native-svg/android/src/main/jni/. -I/Users/Workspace/xx/node_modules/react-native-svg/android/src/main/jni/../../../../common/cpp -I/Users/Workspace/xx/node_modules/react-native-svg/android/src/main/jni/../../../build/generated/source/codegen/jni -I/Users/Workspace/xx/node_modules/react-native-svg/android/src/main/jni/../../../build/generated/source/codegen/jni/react/renderer/components/rnsvg -I/Users/Workspace/xx/node_modules/react-native-vector-icons/android/build/generated/source/codegen/jni/. -I/Users/Workspace/xx/node_modules/react-native-vector-icons/android/build/generated/source/codegen/jni/react/renderer/components/RNVectorIconsSpec -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/fabricjni/include -isystem /Users/.gradle/caches/transforms-4/c7e26f7d3c2fc1a6636ff1467fc77795/transformed/jetified-fbjni-0.6.0/prefab/modules/fbjni/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/folly_runtime/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/glog/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/jsi/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_codegen_rncore/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_debug/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_utils/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_nativemodule_core/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_newarchdefaults/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_cxxreactpackage/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_componentregistry/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_core/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_debug/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_graphics/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_imagemanager/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_mapbuffer/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_render_textlayoutmanager/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/rrc_image/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/rrc_view/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/rrc_text/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/rrc_textinput/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/rrc_legacyviewmanagerinterop/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/runtimeexecutor/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/turbomodulejsijni/include -isystem /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/yoga/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fno-limit-debug-info -fPIC -Wall -Werror -Wno-error=cpp -fexceptions -frtti -std=c++20 -DLOG_TAG=\"ReactNative\" -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_MOBILE=1 -DFOLLY_HAVE_RECVMMSG=1 -DFOLLY_HAVE_PTHREAD=1 -DFOLLY_HAVE_XSI_STRERROR_R=1 -MD -MT CMakeFiles/appmodules.dir/OnLoad.cpp.o -MF CMakeFiles/appmodules.dir/OnLoad.cpp.o.d -o CMakeFiles/appmodules.dir/OnLoad.cpp.o -c /Users/Workspace/xx/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp

C/C++: /Users/Workspace/xx/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:74:10: error: use of undeclared identifier 'rncli_cxxModuleProvider'; did you mean 'rncli_ModuleProvider'? C/C++: return rncli_cxxModuleProvider(name, jsInvoker); C/C++: ^~~~~~~ C/C++: rncli_ModuleProvider C/C++: /Users/Workspace/xx/android/app/build/generated/rncli/src/main/jni/rncli.h:19:30: note: 'rncli_ModuleProvider' declared here C/C++: std::shared_ptr rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params); C/C++: ^ C/C++: /Users/Workspace/xx/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:74:40: error: no viable conversion from 'const std::shared_ptr' to 'const JavaTurboModule::InitParams' C/C++: return rncli_cxxModuleProvider(name, jsInvoker); C/C++: ^~~~~ C/C++: /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_nativemodule_core/include/ReactCommon/JavaTurboModule.h:28:10: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const std::shared_ptr' to 'const InitParams &' for 1st argument C/C++: struct InitParams { C/C++: ^ C/C++: /Users/.gradle/caches/transforms-4/441abbc29e7844d504dda1a0ffede014/transformed/jetified-react-android-0.74.1-debug/prefab/modules/react_nativemodule_core/include/ReactCommon/JavaTurboModule.h:28:10: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const std::shared_ptr' to 'InitParams &&' for 1st argument C/C++: /Users/Workspace/xx/android/app/build/generated/rncli/src/main/jni/rncli.h:19:116: note: passing argument to parameter 'params' here C/C++: std::shared_ptr rncli_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params); C/C++: ^ C/C++: 2 errors generated.

I could build & run iOS version, is it possible that I missed something to update when I do upgrade from 0.72 to 0.74.1?

MrRefactor commented 5 months ago

i got the same error here too with latest version - react native: 0.74.1

Task :app:buildCMakeDebug[arm64-v8a] C/C++: ninja: Entering directory `/Users/Workspace/xx/android/app/.cxx/Debug/h1j1a4m5/arm64-v8a' C/C++: /Users/Library/Android/sdk/ndk/26.1.10909125/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --

I have the same error as above, iOS build running fine.

abhayagrawal-fareye commented 2 months ago

Facing same error on version 0.74.5 -

System: OS: macOS 14.5 CPU: (8) arm64 Apple M1 Memory: 131.44 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 18.18.0 path: ~/.nvm/versions/node/v18.18.0/bin/node Yarn: Not Found npm: version: 9.8.1 path: ~/.nvm/versions/node/v18.18.0/bin/npm Watchman: version: 2023.12.04.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.14.3 path: /Users/abhayagrawal/.gem/ruby/3.2.2/bin/pod SDKs: iOS SDK: Platforms:

szymonrybczak commented 2 months ago

@abhayagrawal-fareye please make sure that there's no package that overrides CLI packages, that was the solution for similar cases that you face - someone had an older dependency e.g. react-native-macos which was overriding @react-native-community/cli packages and then code couldn't be generated in correct way, because of the dependency mismatch under the hood.