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

Create library with 0.41.2 can't build ios example #643

Closed
1 of 2 tasks
LuongTruong opened this issue Oct 1, 2024 · 4 comments
Closed
1 of 2 tasks

Create library with 0.41.2 can't build ios example #643

LuongTruong opened this issue Oct 1, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@LuongTruong
Copy link

Description

  1. Run cmd: npx [email protected] RNExample
  2. Run cmd: yarn to install node_modules
  3. Run cmd: pod install to install Pods
  4. Open iOS project and press build

As a result, I receive the error message: "exited with status code 127"

Packages

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

Selected options

I created:

  • Turbo module
  • Vanilla

Link to repro

Create a new library using the version 0.41.2

Environment

System:
OS: macOS 15.0
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 164.05 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.12.2
path: /usr/local/bin/node
Yarn:
version: 3.6.1
path: /usr/local/bin/yarn
npm:
version: 10.8.1
path: /usr/local/bin/npm
Watchman:
version: 2024.07.01.00
path: /usr/local/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 24.0
- iOS 18.0
- macOS 15.0
- tvOS 18.0
- visionOS 2.0
- watchOS 11.0
Android SDK:
API Levels:
- "28"
- "30"
- "31"
- "33"
- "34"
Build Tools:
- 28.0.3
- 29.0.2
- 30.0.2
- 30.0.3
- 31.0.0
- 33.0.0
- 33.0.1
- 34.0.0
- 35.0.0
System Images:
- android-34 | Google APIs Intel x86_64 Atom
- android-34 | Google Play Intel x86_64 Atom
Android NDK: 22.1.7171670
IDEs:
Android Studio: 2024.1 AI-241.19072.14.2412.12360217
Xcode:
version: 16.0/16A242d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.9
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.75.3
wanted: 0.75.3
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: false
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

@LuongTruong LuongTruong added the bug Something isn't working label Oct 1, 2024
@mariojose96
Copy link

That's just the error code, the actual error log is in the Issues section by clicking on the error.

If you're only having these issues when building via Xcode, and can successfully build from the example folder with `npm build:ios' from the terminal, the following may help, assuming it's the same problem I had where Xcode can't find npx:

  1. In Xcode go to Product > Scheme > Edit Scheme
  2. Select the “Build” tab on the left
  3. In the “Pre-actions” and “Post-actions” sections, add the following line to set the correct path for npx:
    export PATH="$PATH:$(npm bin -g)"
  4. Try to build again

@LuongTruong
Copy link
Author

Hello @mariojose96

I tried to run the build:ios in package.json but it runs like forever.

I follow your action but still receive the error

  1. In Xcode go to Product > Scheme > Edit Scheme
  2. Select the “Build” tab on the left
  3. In the “Pre-actions” and “Post-actions” sections, add the following line to set the correct path for npx: export PATH="$PATH:$(npm bin -g)
  4. Try to build again

Please take a look at the image for more information. I also select the error message, but there is no more information for me to investigate.

ios-error

@mariojose96
Copy link

Hey @LuongTruong ,
I can reproduce the empty log as well in a new react-native module project using this command: npx create-react-native-library@latest react-native-awesome-module. But changing the build settings as suggested above solved it for me.

There's a good chance that it's just not grabbing the global npx path for you. I can see above that your path would resolve to "/usr/local/bin". Just export to that path directly with this command export PATH="$PATH:/usr/local/bin".

Your build settings Pre-actions should now look like this:
Xcode Build Settings Pre Actions

Add export PATH="$PATH:/usr/local/bin" to Post-Actions too, just to be sure.

@LuongTruong
Copy link
Author

Hey @mariojose96 , thanks for the comment. It helps me to build the app successfully.

I am closing the ticket since the issue is resolved.

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