install react native and project

install react native and project

From https://reactnative.dev/docs/environment-setup

  1. System requirement
    • MacBook pro-2014(4 core, 16GB memory)
    • macOS Catalina(10.15.7)
    • Xcode v11.5
    • node v12.20.1
    • npm v6.14.10
  2. Environment config follow by https://reactnative.dev/docs/environment-setup
  3. Create new project
    • npx react-native init TestHello
    • cd TestHello
      yarn ios
  4. Solve issue: ios/Pods/Headers/Private
    /Flipper-Folly/folly/portability/Time.h:51:17: Typedef redefinition with di
    fferent types (‘uint8_t’ (aka ‘unsigned char’) vs ‘enum clockid_t’)

    • https://github.com/facebook/flipper/issues/834
    • Open ios/Pods/Headers/Private/Flipper-Folly/folly/portability/Time.h
    • Change
    • (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 || \
      __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)
    • to
    • (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_15 || \
      __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_12_0)
  5. Solve issue: ios/Pods/Headers/Public/l
    ibevent/event.h:44:10: ‘event2/event-config.h’ file not found

    • https://stackoverflow.com/questions/66019068/event2-event-config-h-file-not-found/66034412
    • edit ios/Podfile from
    • use_flipper!
      post_install do |installer|
      flipper_post_install(installer)
      end
    • to
    • use_flipper!(‘Flipper’ => ‘0.74.0’)
      post_install do |installer|
      flipper_post_install(installer)
      end
    • pod install
    • sudo gem install cocoapods
  6. Result(yarn ios)
No Comments

Post A Comment