Install React Native Android Running Environment (MacOS):
Step 1. Install the latest JDK from: Here
Step 2. Use
brew cask install android-sdk to install Android SDK
Step 3. Add Android SDK to your environment by:
Note: if you want to update the android sdk, use the
Step 4. Open a new terminal window and type
android, in the following window make sure select:
* Android 6.0 (API 23)
* Android Support Repository intel x86 Emulator
* Android SDK build Tool 23.0.1
Step 5. Install the adb:
brew cask install android-platform-tools
Step 6. Install the following tools:
brew install watchman:
watchman is a tool to monitor the file changes. With such a tool, we can have real-time reveal on devices or simulators.
brew install flow:
Some basic concepts:
- You can definitely use React without JSX but JSX makes React a lot more elegant. Just like XML, JSX tags have a tag name, attributes, and children.
- JSX syntax can help you to run js and html together.
Some common error:
- Error "type error undefined is not a function evaluating bridge"
Solution: close the
npm start terminal and restart
- When building app on Android, sometimes you will encounter such an error:
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
Solution: check the permission on gradle under android. It should be 755 not 644.