Skip to content

Instantly share code, notes, and snippets.

@findmory
Last active April 5, 2019 21:09
Show Gist options
  • Save findmory/52facd61b492b13f0c7f67db4cf79012 to your computer and use it in GitHub Desktop.
Save findmory/52facd61b492b13f0c7f67db4cf79012 to your computer and use it in GitHub Desktop.
Starting a new project with react-native init

As of 9/24/2018 here are the versions running and the steps to start a clean project

Check your versions: react-native init

React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.6
      CPU: x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
      Memory: 108.35 MB / 16.00 GB
      Shell: 5.4.2 - /usr/local/bin/zsh
    Binaries:
      Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node
      Yarn: 1.9.4 - /usr/local/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v8.12.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
    IDEs:
      Xcode: 10.0/10A255 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0
      react-native: 0.57.1 => 0.57.1
    npmGlobalPackages:
      react-native-cli: 2.0.1

Start a new project: react-native init <projectname>

Open the project in Xcode and run it - if you see error about 3rd party libraries run this:

cd node_modules/react-native/third-party/glog-0.3.5/ && ../../scripts/ios-configure-glog.sh && cd ../../../../

If you get error about @babel/runtime add this specific version to package.json in devDependencies

{
	...
    "@babel/runtime": "7.0.0-beta.55”

}

and run yarn install to update the project with that version of babel

Your project should now build in Xcode and open the simulator

If you try to run the tvOS build you will need to make two changes

And then correct Fishhook library linkage

Fixing these items also allows react-native run-ios to work. Also to run a specific simulator , first list devices: xcrun simctl list devices

Then use one with --simulator="iPhone 4s"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment