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

A problem occurred evaluating script. > Command '[node, [PROJECT_PATH]/node_modules/@react-native-community/cli/build/bin.js, config, --platform, android]' failed with exit code 1. #2502

Open
lhogan3 opened this issue Sep 12, 2024 · 6 comments
Labels
question Further information is requested stale

Comments

@lhogan3
Copy link

lhogan3 commented Sep 12, 2024

Ask your Question

Similar, but not the same as #2469.

My team and I have been running into this android build issue for a month now and have not been able to come up with a solution. This occurs when we run either a ./gradlew clean or ./gradlew build.

npx react-native info output:

  OS: macOS 14.6.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 250.11 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.17.1
    path: ~/.nvm/versions/node/v18.17.1/bin/node
  Yarn:
    version: 1.22.21
    path: ~/.nvm/versions/node/v18.17.1/bin/yarn
  npm:
    version: 10.2.0
    path: ~/.nvm/versions/node/v18.17.1/bin/npm
  Watchman:
    version: 2024.09.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    API Levels:
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
      - android-35 | Google APIs ARM 64 v8a
      - android-35 | Google APIs Intel x86_64 Atom
      - android-35 | Google Play ARM 64 v8a
      - android-35 | Google Play Intel x86_64 Atom
      - android-35 | Google Play Experimental 16k Page Size ARM 64 v8a
      - android-35 | Google Play Experimental 16k Page Size Intel x86_64 Atom
      - android-35 | Pre-Release 16 KB Page Size Google APIs ARM 64 v8a
      - android-35 | Pre-Release 16 KB Page Size Google APIs Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11668458
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: 0.73.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Any help with this would be much appreciated, thank you.

@lhogan3 lhogan3 added the question Further information is requested label Sep 12, 2024
@xgenem
Copy link

xgenem commented Sep 13, 2024

+1 Same thing's happening. I read solutions like putting resolutions but didn't help.

@robhogan
Copy link
Collaborator

robhogan commented Sep 13, 2024

All this log says is that the JS script failed, which could be for any number of reasons.

Can you get the script's output (maybe further up in the Gradle output), or run it directly outside of the Gradle build, so we can see what's happening?

node node_modules/@react-native-community/cli/build/bin.js config --platform android

@xgenem
Copy link

xgenem commented Sep 13, 2024

@robhogan I got an error on that command

error: unknown option --platform

Below are some more details from the experienced error. I tried changing the cli version to latest and it's the same, same when going down.


* Where:
Script '<PROJECT_PATH>/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 397

* What went wrong:
A problem occurred evaluating script.
> Could not find method exec() for arguments [ReactNativeModules$_getCommandOutput_closure16@37846d19] on object of type org.gradle.api.internal.provider.DefaultProviderFactory_Decorated.

@lhogan3
Copy link
Author

lhogan3 commented Sep 13, 2024

@robhogan @xgenem's description above is what we are receiving as well. Seems as though when @react-native-community/cli/build/bin.js is run we get the error: unknown option --platform.

Agreed as well with the fact that we have tried downgrading the CLI with no different behavior. Do you have any suggestions here?

@lhogan3
Copy link
Author

lhogan3 commented Sep 16, 2024

@robhogan @xgenem It seems as though this might be an issue with the version of react-native not pulling in the fix that is explained here: #2470

Seems as though this was found and fixed in @react-native-community/cli v14.0.1: facebook/react-native#46124

Would this be able to be updated for react-native v73.6?

Copy link

There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.

@github-actions github-actions bot added the stale label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale
Projects
None yet
Development

No branches or pull requests

3 participants