Windows 10 & React Native & Android

Windows 10 & React Native & Android

https://facebook.github.io/react-native/docs/getting-started

https://reactnative.cn/docs/getting-started.html

ANDROID_HOME

env

Windows 10 & React Native & Android

Android Virtual Device (AVD)

https://developer.android.com/studio/run/managing-avds.html

Windows 10 & React Native & Android

https://gradle.org/help/

not running an AVD bug

Windows 10 & React Native & Android

solution

OK

Windows 10 & React Native & Android

https://*.com/questions/32634352/react-native-android-build-failed-sdk-location-not-found

H:\Android-SDK

sdk.dir = H:\Android-SDK

  1. Go to the android/ directory of your react-native project
  2. Create a file called local.properties with this line:
# macOS / Linux
sdk.dir = /Users/USERNAME/Library/Android/sdk # Windows
sdk.dir = C:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk

adb bug

PATH env bug

Windows 10 & React Native & Android

Windows 10 & React Native & Android

solutions

Windows 10 & React Native & Android

abd

# PATH

'adb' is not recognized as an internal or external command,

H:\Android-SDK\platform-tools

https://*.com/questions/20564514/adb-is-not-recognized-as-an-internal-or-external-command-operable-program-or

# global
setx PATH "%PATH%;C:\Program Files\android-sdk-windows\platform-tools" # session
set PATH=%PATH%;C:\Program Files\android-sdk-windows\platform-tools
set PATH=%PATH%;H:\Android-SDK\platform-tools

Android

https://facebook.github.io/react-native/docs/getting-started

https://chocolatey.org/

https://github.com/chocolatey

https://www.python.org/downloads/release/python-2716/

https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

# Node, Python2, JDK
$ choco install -y nodejs.install python2 jdk8 # ANDROID_HOME
# c:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk $ H:\Android-SDK\platform-tools

Android 9 (Pie)

Windows 10 & React Native & Android

relaod

⌘ + M & Ctrl+M

  1. manually reload

  2. auto reload

  3. hot reload

Windows 10 & React Native & Android

https://facebook.github.io/react-native/docs/debugging#reloading-javascript

https://facebook.github.io/react-native/docs/debugging#enabling-keyboard-shortcuts


上一篇:poj 2886 "Who Gets The Most Candies?"(树状数组)


下一篇:玩转 SpringBoot2.x 之整合邮件发送