Skip to content

Can't create new native module!!! #50455

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

Closed
antondev-123 opened this issue Apr 2, 2025 · 1 comment
Closed

Can't create new native module!!! #50455

antondev-123 opened this issue Apr 2, 2025 · 1 comment
Labels
Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library

Comments

@antondev-123
Copy link

Description

Hello everyone,

I tried to create a new Turbo native module for android.

npx create-react-native-library@latest awesome-library

yarn

yarn example android

Unfortunately, I couldn't because this error happened.

This was a fresh module and I had never changed any code.

Looking forward to your advice.
🙏

Steps to reproduce

  1. Create Native Module with npx create-react-native-library@latest awesome-library
  2. Install dependencies with 'yarn'
  3. Test the example with yarn example android
  4. Error:
PS F:\Work-U\react-native\react-native-floating-bubble-plugin(new)> yarn example android
info Installing the app...

> Task :app:invokeLibraryCodegen
ℹ [codegen] Cleaning up previous iOS codegen native code at ios\generated
ℹ [codegen] Cleaning up previous Android codegen native code at android\generated
Γ£ö [codegen] Generated native code with codegen

> Task :app:configureCMakeDebug[arm64-v8a]
C/C++: CMake Warning in F:/Work-U/react-native/react-native-floating-bubble-plugin(new)/android/generated/jni/CMakeLists.txt:
C/C++:   The object file directory
C/C++:     F:/Work-U/react-native/react-native-floating-bubble-plugin(new)/example/android/app/.cxx/Debug/2e4c1i6n/arm64-v8a/RNFloatingBubblePluginSpec_autolinked_build/CMakeFiles/react_codegen_RNFloatingBubblePluginSpec.dir/./
C/C++:   has 216 characters.  The maximum full path to an object file is 250
C/C++:   characters (see CMAKE_OBJECT_PATH_MAX).  Object file
C/C++:     react/renderer/components/RNFloatingBubblePluginSpec/RNFloatingBubblePluginSpecJSI-generated.cpp.o
C/C++:   cannot be safely placed under this directory.  The build may not work
C/C++:   correctly.

> Task :app:buildCMakeDebug[arm64-v8a] FAILED
C/C++: ninja: error: mkdir(RNFloatingBubblePluginSpec_autolinked_build/CMakeFiles/react_codegen_RNFloatingBubblePluginSpec.dir/react/renderer/components/RNFloatingBubblePluginSpec): No such file or directory

[Incubating] Problems report is available at: file:///F:/Work-U/react-native/react-native-floating-bubble-plugin(new)/example/android/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.12/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.      
63 actionable tasks: 10 executed, 53 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor 


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `F:\Work-U\react-native\react-native-floating-bubble-plugin(new)\example\android\app\.cxx\Debug\2e4c1i6n\arm64-v8a'
  [0/2] Re-checking globbed directories...
  ninja: build stopped: .

  C++ build system [build] failed while executing:
      @echo off
      "C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^
        -C ^
        "F:\\Work-U\\react-native\\react-native-floating-bubble-plugin(new)\\example\\android\\app\\.cxx\\Debug\\2e4c1i6n\\arm64-v8a" ^
        appmodules
    from F:\Work-U\react-native\react-native-floating-bubble-plugin(new)\example\android\app
  ninja: error: mkdir(RNFloatingBubblePluginSpec_autolinked_build/CMakeFiles/react_codegen_RNFloatingBubblePluginSpec.dir/react/renderer/components/RNFloatingBubblePluginSpec): No such file or directory

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 14s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:buildCMakeDebug[arm64-v8a]'. > com.android.ide.common.process.ProcessException: ninja: Entering directory `F:\Work-U\react-native\react-native-floating-bubble-plugin(new)\example\android\app\.cxx\Debug\2e4c1i6n\arm64-v8a' [0/2] Re-checking globbed directories... ninja: build stopped: . C++ build system [build] failed while executing: @echo off "C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^ -C ^ "F:\\Work-U\\react-native\\react-native-floating-bubble-plugin(new)\\example\\android\\app\\.cxx\\Debug\\2e4c1i6n\\arm64-v8a" ^ appmodules from F:\Work-U\react-native\react-native-floating-bubble-plugin(new)\example\android\app ninja: error: mkdir(RNFloatingBubblePluginSpec_autolinked_build/CMakeFiles/react_codegen_RNFloatingBubblePluginSpec.dir/react/renderer/components/RNFloatingBubblePluginSpec): No such file or directory * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 14s.
info Run CLI with --verbose flag for more details.

React Native Version

0.78.2

Affected Platforms

Build - Windows, Runtime - Android

Areas

TurboModule - The New Native Module System

Output of npx @react-native-community/cli info

System:
  OS: Windows 11 10.0.26100
  CPU: (12) x64 Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
  Memory: 12.51 GB / 31.84 GB
Binaries:
  Node:
    version: 22.13.0
    path: C:\nvm4w\nodejs\node.EXE
  Yarn:
    version: 3.6.1
    path: ~\AppData\Roaming\npm\yarn.CMD
  npm:
    version: 11.2.0
    path: C:\nvm4w\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-242.23726.103.2422.12816248
  Visual Studio: Not Found
Languages:
  Java: 17.0.9
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.78.2
    wanted: 0.78.2
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

info Installing the app...

> Task :app:invokeLibraryCodegen
ℹ [codegen] Cleaning up previous iOS codegen native code at ios\generated
ℹ [codegen] Cleaning up previous Android codegen native code at android\generated
Γ£ö [codegen] Generated native code with codegen

> Task :app:configureCMakeDebug[arm64-v8a]
C/C++: CMake Warning in F:/Work-U/react-native/react-native-floating-bubble-plugin(new)/android/generated/jni/CMakeLists.txt:
C/C++:   The object file directory
C/C++:     F:/Work-U/react-native/react-native-floating-bubble-plugin(new)/example/android/app/.cxx/Debug/2e4c1i6n/arm64-v8a/RNFloatingBubblePluginSpec_autolinked_build/CMakeFiles/react_codegen_RNFloatingBubblePluginSpec.dir/./
C/C++:   has 216 characters.  The maximum full path to an object file is 250
C/C++:   characters (see CMAKE_OBJECT_PATH_MAX).  Object file
C/C++:     react/renderer/components/RNFloatingBubblePluginSpec/RNFloatingBubblePluginSpecJSI-generated.cpp.o
C/C++:   cannot be safely placed under this directory.  The build may not work
C/C++:   correctly.

> Task :app:buildCMakeDebug[arm64-v8a] FAILED
C/C++: ninja: error: mkdir(RNFloatingBubblePluginSpec_autolinked_build/CMakeFiles/react_codegen_RNFloatingBubblePluginSpec.dir/react/renderer/components/RNFloatingBubblePluginSpec): No such file or directory

[Incubating] Problems report is available at: file:///F:/Work-U/react-native/react-native-floating-bubble-plugin(new)/example/android/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.12/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.      
63 actionable tasks: 10 executed, 53 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor 


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `F:\Work-U\react-native\react-native-floating-bubble-plugin(new)\example\android\app\.cxx\Debug\2e4c1i6n\arm64-v8a'
  [0/2] Re-checking globbed directories...
  ninja: build stopped: .

  C++ build system [build] failed while executing:
      @echo off
      "C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^
        -C ^
        "F:\\Work-U\\react-native\\react-native-floating-bubble-plugin(new)\\example\\android\\app\\.cxx\\Debug\\2e4c1i6n\\arm64-v8a" ^
        appmodules
    from F:\Work-U\react-native\react-native-floating-bubble-plugin(new)\example\android\app
  ninja: error: mkdir(RNFloatingBubblePluginSpec_autolinked_build/CMakeFiles/react_codegen_RNFloatingBubblePluginSpec.dir/react/renderer/components/RNFloatingBubblePluginSpec): No such file or directory

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 14s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:buildCMakeDebug[arm64-v8a]'. > com.android.ide.common.process.ProcessException: ninja: Entering directory `F:\Work-U\react-native\react-native-floating-bubble-plugin(new)\example\android\app\.cxx\Debug\2e4c1i6n\arm64-v8a' [0/2] Re-checking globbed directories... ninja: build stopped: . C++ build system [build] failed while executing: @echo off "C:\\Users\\Administrator\\AppData\\Local\\Android\\Sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^ -C ^ "F:\\Work-U\\react-native\\react-native-floating-bubble-plugin(new)\\example\\android\\app\\.cxx\\Debug\\2e4c1i6n\\arm64-v8a" ^ appmodules from F:\Work-U\react-native\react-native-floating-bubble-plugin(new)\example\android\app ninja: error: mkdir(RNFloatingBubblePluginSpec_autolinked_build/CMakeFiles/react_codegen_RNFloatingBubblePluginSpec.dir/react/renderer/components/RNFloatingBubblePluginSpec): No such file or directory * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 14s.
info Run CLI with --verbose flag for more details.

Reproducer

https://github.com/antondev-123/react-native-floating-bubble-plugin-new

Screenshots and Videos

No response

@antondev-123 antondev-123 added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Apr 2, 2025
@antondev-123 antondev-123 changed the title New Native Module is not working!!! Can't create new native module!!! Apr 2, 2025
@migueldaipre
Copy link
Collaborator

Hi @antondev-123, Thanks for reporting this issue.

It seems that this problem is not related to the React Native core, but is related to the create-react-native-library you mentioned or possibly to the name of your folder, exceeding 250 characters. Please open this issue in another repository:

https://github.com/callstack/react-native-builder-bob/issues

@migueldaipre migueldaipre added Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library and removed Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Issue in another tool or repo An issue that was opened against React Native but in reality is affecting another tool or library
Projects
None yet
Development

No branches or pull requests

2 participants