facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.22k stars 24.22k forks source link

IOS build takes too long and never finishes for 0.75.2 version #46380

Closed SergenSiyli closed 4 days ago

SergenSiyli commented 1 week ago

Description

I m trying to run npx react-native run-ios command. But I'm waiting too long time for build. I m still waiting 1 hours. I think the latest version of react native has problems for ios. I've been waiting for hours for the app to open in the simulator. I tried many option. I deleted simulator ,reset macbook and created new project. but still same ı think has problem for ios build this version 0.75.2. ⠼ Building the app.........

Steps to reproduce

npx @react-native-community/cli@latest init AwesomeProject npx react-native run-ios

React Native Version

0.75.2

Affected Platforms

Runtime - iOS, Build - MacOS

Output of npx react-native info

npx react-native info
info Fetching system and libraries information...
System:
  OS: macOS 14.6.1
  CPU: (8) arm64 Apple M2
  Memory: 2.95 GB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.9.0
    path: /usr/local/bin/node
  Yarn: Not Found
  npm:
    version: 10.1.0
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.03.18.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /usr/local/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:
      - "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 NDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.11090377
  Xcode:
    version: 15.0/15A240d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 21.0.3
    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.2
    wanted: 0.75.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

⠼ Building the app.........

Reproducer

https://github.com/SergenSiyli

Screenshots and Videos

Screenshot 2024-09-07 at 22 48 03

react-native-bot commented 1 week ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
react-native-bot commented 1 week ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
cipolleschi commented 1 week ago

@SergenSiyli sorry to hear that the build time is taking too long.

Can you check a couple of things for me?

  1. Can you try to build from Xcode and see if the build numbers increases or not?

    Screenshot 2024-09-09 at 12 11 10
  2. Can you run bundle exec pod deintegrate and then reinstall pods? What I'm looking for is to understand whether you are using a prebuild version of Hermes or if you are trying to build hermes from source, as it is usually one of the pieces that takes most time (and that's why we are distributing prebuilds)

    Screenshot 2024-09-09 at 12 14 08

    See the yellow line in the screenshot

SergenSiyli commented 1 week ago

@SergenSiyli sorry to hear that the build time is taking too long.

Can you check a couple of things for me?

  1. Can you try to build from Xcode and see if the build numbers increases or not?
Screenshot 2024-09-09 at 12 11 10
  1. Can you run bundle exec pod deintegrate and then reinstall pods? What I'm looking for is to understand whether you are using a prebuild version of Hermes or if you are trying to build hermes from source, as it is usually one of the pieces that takes most time (and that's why we are distributing prebuilds)

Screenshot 2024-09-09 at 12 14 08 See the yellow line in the screenshot

1-) IOS Build Result:

Screenshot 2024-09-09 at 19 06 51 Screenshot 2024-09-09 at 19 08 11

2-) My pod install result:

Screenshot 2024-09-09 at 19 10 32
cipolleschi commented 6 days ago

@SergenSiyli That error is because you are not running Metro.

in a separate terminal window, please run:

1. cd <path-to-your-project>
2. yarn start

Then relaunch the app or press the Reload button in the tab bar of the Red screen.

Build was successful if you ended up in that screen.

SergenSiyli commented 5 days ago

@SergenSiyli That error is because you are not running Metro.

in a separate terminal window, please run:

1. cd <path-to-your-project>
2. yarn start

Then relaunch the app or press the Reload button in the tab bar of the Red screen.

Build was successful if you ended up in that screen.

I solved the problem in the first item. I got a successful build on xcode. But the application still does not build with the npx react-native run-ios command. What can I do?

EzioLi01 commented 4 days ago

Same system (Apple M2, macOS 14.6.1) and same issue, from 0.75.

cipolleschi commented 4 days ago

duplicate of #46352, please focus all the comments on the previous issue. We will work on this soon. Until then, please use Xcode to build if you are facing the issue.

Also, we use the same command on CI to build a sample project called hello world and I tested that yarn ios worked for me in a new project with 0.75.2. There might be something going on with your system configuration.