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

Project with path ':react-native-nitro-modules' #777

Open
1 of 2 tasks
sawa-ko opened this issue Feb 24, 2025 · 3 comments
Open
1 of 2 tasks

Project with path ':react-native-nitro-modules' #777

sawa-ko opened this issue Feb 24, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@sawa-ko
Copy link

sawa-ko commented Feb 24, 2025

Description

I am trying to make a Scaffold to React Native library in my existing project, but when I try to use, in this case, the example files generated by react-native-builder-bob I get the following error.

PS C:\Users\inmor\WebstormProjects\sercargo-warehouse> pnpm android

> [email protected] android C:\Users\inmor\WebstormProjects\sercargo-warehouse
> expo run:android

env: load .env
env: export EXPO_PUBLIC_API_URL
› Building app...
Configuration on demand is an incubating feature.

> Configure project :app
 Ôä╣´©Å  Applying gradle plugin 'expo-dev-launcher-gradle-plugin' ([email protected])

> Configure project :scl_react-native-scanner-manager
[NitroModules] ­ƒöÑ scl_reactnativescannermanager is boosted by nitro!

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@scl\react-native-scanner-manager\android\build.gradle' line: 153

* What went wrong:
A problem occurred evaluating project ':scl_react-native-scanner-manager'.
> Project with path ':react-native-nitro-modules' could not be found in project ':scl_react-native-scanner-manager'.

* 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.

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.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 5s
18 actionable tasks: 4 executed, 14 up-to-date
Error: C:\Users\inmor\WebstormProjects\sercargo-warehouse\android\gradlew.bat app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a,armeabi-v7a exited with non-zero code: 1                                                                                                                                                                                                       
Error: C:\Users\inmor\WebstormProjects\sercargo-warehouse\android\gradlew.bat app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a,armeabi-v7a exited with non-zero code: 1
    at ChildProcess.completionListener (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@expo\spawn-async\src\spawnAsync.ts:67:13)
    at Object.onceWrapper (node:events:622:26)
    at ChildProcess.emit (node:events:507:28)
    at ChildProcess.cp.emit (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (node:internal/child_process:1101:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
    ...
    at spawnAsync (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@expo\spawn-async\src\spawnAsync.ts:28:21)
    at spawnGradleAsync (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@expo\cli\src\start\platforms\android\gradle.ts:134:28)
    at assembleAsync (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@expo\cli\src\start\platforms\android\gradle.ts:83:16)
    at runAndroidAsync (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@expo\cli\src\run\android\runAndroidAsync.ts:48:24)
 ELIFECYCLE  Command failed with exit code 1.

I don't know what else to do, I can't get it to work.

Image

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

Image

Link to repro

N/A

Environment

PS C:\Users\inmor\WebstormProjects\sercargo-warehouse> pnpm react-native info
info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.26100
  CPU: "(16) x64 AMD Ryzen 7 3700X 8-Core Processor             "
  Memory: 3.39 GB / 15.93 GB
Binaries:
  Node:
    version: 23.8.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 10.9.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.12.35527.113 (Visual Studio Community 2022)
Languages:
  Java: 21.0.5
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 15.1.3
    wanted: ^15.1.3
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.7
    wanted: 0.76.7
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
@sawa-ko sawa-ko added the bug Something isn't working label Feb 24, 2025
@atlj
Copy link
Collaborator

atlj commented Feb 24, 2025

@sawa-ko I think you're missing react-native-nitro-modules dependency in your expo app. Could you install it? The library bob generated for you has a README.md file and it should include the instructions.

@sawa-ko
Copy link
Author

sawa-ko commented Feb 24, 2025

@atlj Yes, you were right, but now I have the following error:

PS C:\Users\inmor\WebstormProjects\sercargo-warehouse> yarn android
env: load .env
env: export EXPO_PUBLIC_API_URL
› Building app...
Configuration on demand is an incubating feature.

> Configure project :app
 Ôä╣´©Å  Applying gradle plugin 'expo-dev-launcher-gradle-plugin' ([email protected])

> Configure project :shopify_react-native-skia
react-native-skia: node_modules/ found at: C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules
react-native-skia: RN Version: 76 / 0.76.7
react-native-skia: isSourceBuild: false
react-native-skia: PrebuiltDir: C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@shopify\react-native-skia\android\build/react-native-0*/jni
react-native-skia: buildType: debug
react-native-skia: buildDir: C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@shopify\react-native-skia\android\build
react-native-skia: node_modules: C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules
react-native-skia: Enable Prefab: true
react-native-skia: aar state post 70, do nothing

> Configure project :expo

Using expo modules
  - expo-asset (11.0.4)
  - expo-blur (14.0.3)
  - expo-camera (16.0.17)
  - expo-constants (17.0.7)
  - expo-dev-client (5.0.12)
  - expo-dev-launcher (5.0.29)
  - expo-dev-menu (6.0.19)
  - expo-file-system (18.0.11)
  - expo-font (13.0.4)
  - expo-haptics (14.0.1)
  - expo-image (2.0.6)
  - expo-json-utils (0.14.0)
  - expo-keep-awake (14.0.3)
  - expo-linking (7.0.5)
  - expo-manifests (0.15.7)
  - expo-modules-core (2.2.2)
  - expo-secure-store (14.0.1)
  - expo-splash-screen (0.29.22)
  - expo-sqlite (15.1.2)
  - expo-system-ui (4.0.8)
  - expo-web-browser (14.0.2)


> Configure project :react-native-nitro-modules
[NitroModules] ­ƒöÑ Your app is boosted by nitro modules!

> Configure project :react-native-reanimated
Android gradle plugin: 8.6.0
Gradle: 8.10.2

> Configure project :react-native-scanner-manager
[NitroModules] ­ƒöÑ scannermanager is boosted by nitro!

> Task :react-native-scanner-manager:generateCodegenSchemaFromJavaScript                                                                                                                                                            
No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules.                                     

> Task :app:processDebugMainManifest                                                                                                                                                                                                
C:\Users\inmor\WebstormProjects\sercargo-warehouse\android\app\src\debug\AndroidManifest.xml:6:5-162 Warning:
        application@android:usesCleartextTraffic was tagged at AndroidManifest.xml:6 to replace other declarations but no other declaration present
C:\Users\inmor\WebstormProjects\sercargo-warehouse\android\app\src\debug\AndroidManifest.xml Warning:
        provider#expo.modules.filesystem.FileSystemFileProvider@android:authorities was tagged at AndroidManifest.xml:0 to replace other declarations but no other declaration present

> Task :react-native-reanimated:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :shopify_react-native-skia:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :react-native-gesture-handler:compileDebugKotlin
w: file:///C:/Users/inmor/WebstormProjects/sercargo-warehouse/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/FlingGestureHandler.kt:25:26 Parameter 'event' is never used
w: file:///C:/Users/inmor/WebstormProjects/sercargo-warehouse/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt:79:62 The corresponding parameter in the supertype 'ViewGroupManager' is named 'borderRadius'. This may cause problems when calling this function with named arguments.
w: file:///C:/Users/inmor/WebstormProjects/sercargo-warehouse/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt:84:63 The corresponding parameter in the supertype 'ViewGroupManager' is named 'borderRadius'. This may cause problems when calling this function with named arguments.
w: file:///C:/Users/inmor/WebstormProjects/sercargo-warehouse/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt:89:65 The corresponding parameter in the supertype 'ViewGroupManager' is named 'borderRadius'. This may cause problems when calling this function with named arguments.
w: file:///C:/Users/inmor/WebstormProjects/sercargo-warehouse/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt:94:66 The corresponding parameter in the supertype 'ViewGroupManager' is named 'borderRadius'. This may cause problems when calling this function with named arguments.

> Task :react-native-reanimated:configureCMakeDebug[arm64-v8a]
C/C++: CMake Warning:
C/C++:   Manually-specified variables were not used by the project:
C/C++:     ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES

> Task :app:compileDebugJavaWithJavac FAILED
C:\Users\inmor\WebstormProjects\sercargo-warehouse\android\app\build\generated\autolinking\src\main\java\com\facebook\react\PackageList.java:26: error: cannot find symbol
import com.margelo.nitro.scannermanager.ScannerManagerPackage;
                                       ^
  symbol:   class ScannerManagerPackage
  location: package com.margelo.nitro.scannermanager
C:\Users\inmor\WebstormProjects\sercargo-warehouse\android\app\build\generated\autolinking\src\main\java\com\facebook\react\PackageList.java:84: error: cannot find symbol
      new ScannerManagerPackage(),
          ^
  symbol:   class ScannerManagerPackage
  location: class PackageList
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
> Run with --info option to get more log output.
> Run with --scan to get full insights.

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.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 1m 3s
698 actionable tasks: 288 executed, 391 from cache, 19 up-to-date
Error: C:\Users\inmor\WebstormProjects\sercargo-warehouse\android\gradlew.bat app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a,armeabi-v7a exited with non-zero code: 1
Error: C:\Users\inmor\WebstormProjects\sercargo-warehouse\android\gradlew.bat app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=arm64-v8a,armeabi-v7a exited with non-zero code: 1
    at ChildProcess.completionListener (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@expo\spawn-async\src\spawnAsync.ts:67:13)
    at Object.onceWrapper (node:events:622:26)
    at ChildProcess.emit (node:events:507:28)
    at ChildProcess.cp.emit (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\cross-spawn\lib\enoent.js:34:29)
    at maybeClose (node:internal/child_process:1101:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
    ...
    at spawnAsync (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@expo\spawn-async\src\spawnAsync.ts:28:21)
    at spawnGradleAsync (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@expo\cli\src\start\platforms\android\gradle.ts:134:28)
    at assembleAsync (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@expo\cli\src\start\platforms\android\gradle.ts:83:16)
    at runAndroidAsync (C:\Users\inmor\WebstormProjects\sercargo-warehouse\node_modules\@expo\cli\src\run\android\runAndroidAsync.ts:48:24)

I have not touched anything in the generated module, just run the codegen command.

Image

@atlj
Copy link
Collaborator

atlj commented Mar 28, 2025

It looks like this only happens with Expo apps. For some reason, Expo autolinks behave differently:

When I create an expo app with Expo SDK 52 (React Native 0.76.7), my nitro module is getting linked like this:

// android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java
import com.margelo.nitro.atlj.reactnativetest.ReactNativeTestPackage;

And a Community CLI app with React Native 0.76.7 looks like this:

// android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java
import com.atlj.reactnativetest.ReactNativeTestPackage;

Thanks for the issue, taking a look 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants