react native - deptno/deptno.github.io GitHub Wiki

react-native

react-native run ios --device "phonename"

์„ค์ •

error

XXApp ์œผ๋กœ ์ด๋ฆ„ ๊ฐ€์ •

The operation couldnโ€™t be completed. Unable to locate a Java Runtime.

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDefaultDebug -PreactNativeDevServerPort=8081
The operation couldnโ€™t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

-> ์ž๋ฐ” ์„ค์น˜

brew install --cask adoptopenjdk/openjdk/adoptopenjdk8

xcrun: error: unable to find utility "simctl", not a developer tool or in PATH

$ react-native run ios
info Found Xcode workspace "XXApp.xcworkspace"
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
error Could not get the simulator list from Xcode. Please open Xcode and try running project directly from there to resolve the remaining issues.
Error: Command failed: xcrun simctl list --json devices
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH

    at checkExecSyncError (node:child_process:826:11)
    at Object.execFileSync (node:child_process:864:15)
    at runOnSimulator (/[APP_PATH]/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js:167:54)
    at Object.runIOS [as func] (/[APP_PATH]/node_modules/@react-native-community/cli-platform-ios/build/commands/runIS/index.js:121:12)
    at Command.handleAction (/[APP_PATH]/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:192:23)
    at Command.listener (/[APP_PATH]/node_modules/commander/index.js:315:8)
    at Command.emit (node:events:390:28)
    at Command.parseArgs (/[APP_PATH]/node_modules/commander/index.js:651:12)
    at Command.parse (/[APP_PATH]/node_modules/commander/index.js:474:21)
    at setupAndRun (/[APP_PATH]/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:271:24)
info Run CLI with --verbose flag for more details.
xcode-select -p
/Library/Developer/CommandLineTools
# ๊ฒฐ๊ณผ๊ฐ€ ์œ„์™€ ๊ฐ™์€ ๊ฒฝ์šฐ ์•„๋ž˜ ์ปค๋งจ๋“œ๋ฅผ ์ž…๋ ฅ
sudo xcode-select --switch /Applications/Xcode.app
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening XXApp.xcworkspace.

xcode ์—์„œ ํŒ€ ์„ค์ • ํ•„์š” error

Error: EMFILE: too many open files, watch

 yarn dev                                                                           1 err  38s  11:33:15
โ— Validation Warning:

  Unknown option "server.enableVisualizer" with value true was found.
  This is probably a typing mistake. Fixing it will remove this message.


               ######                ######
             ###     ####        ####     ###
            ##          ###    ###          ##
            ##             ####             ##
            ##             ####             ##
            ##           ##    ##           ##
            ##         ###      ###         ##
             ##  ########################  ##
          ######    ###            ###    ######
      ###     ##    ##              ##    ##     ###
   ###         ## ###      ####      ### ##         ###
  ##           ####      ########      ####           ##
 ##             ###     ##########     ###             ##
  ##           ####      ########      ####           ##
   ###         ## ###      ####      ### ##         ###
      ###     ##    ##              ##    ##     ###
          ######    ###            ###    ######
             ##  ########################  ##
            ##         ###      ###         ##
            ##           ##    ##           ##
            ##             ####             ##
            ##             ####             ##
            ##          ###    ###          ##
             ###     ####        ####     ###
               ######                ######

                 Welcome to React Native!
                Learn once, write anywhere


node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: EMFILE: too many open files, watch
    at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:204:21)
Emitted 'error' event on NodeWatcher instance at:
    at NodeWatcher.checkedEmitError (/APP/node_modules/sane/src/node_watcher.js:143:12)
    at FSWatcher.emit (node:events:390:28)
    at FSEvent.FSWatcher._handle.onchange (node:internal/fs/watchers:210:12) {
  errno: -24,
  syscall: 'watch',
  code: 'EMFILE',
  filename: null
}

watchman ์„ ์„ค์น˜ํ•˜๋„๋กํ•œ๋‹ค.

์—๋Ÿฌ๋Š” ์‚ฌ๋ผ์ง€์ง€๋งŒ ๊ทผ๋ณธ์ ์ธ ์›์ธ์ธ์ง€๋Š” ๋ถˆ ๋ถ„๋ช…ํ•˜๋‹ค. ์–ด์ œ๋Š” vim์—์„œ๋„ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.
๊ทผ๋ณธ์ ์œผ๋กœ๋Š” OS ์„ค์ •์ผ ๊ฒƒ์œผ๋กœ ๋ณด๋Š”๋ฐ watchman ์ด ์ด๊ฑธ ์–ด๋–ป๊ฒŒ ์ฒ˜๋ฆฌํ•ด์•ผํ•˜๋Š”์ง€๋Š” ์•Œ์•„๋ด์•ผํ•  ๊ฒƒ ๊ฐ™๋‹ค. @todo

sysctl ์„ ํ†ตํ•ด์„œ ๋ณ€์ˆ˜๋ฅผ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

warning: Building targets in manual order is deprecated - choose Dependency Order in scheme settings instead, or set DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING in any of the targets in the current scheme to suppress this warning

schema edit -> build -> dependency order

link