基础
安装
react-native init AwesomeToptalProject
instead of create-react-native-app
, because the latter will be bootstraped with expo and cant add native code.
- 默认 flex 布局
- CSS doesnt cascade, so text color has to be set to Text Element
问题汇总
https://stackoverflow.com/questions/61922174/react-native-on-android-cannot-run-program-node-error-2-no-such-file-or-dir
https://www.geeksforgeeks.org/different-ways-to-fix-error-type-3-error-activity-class-does-not-exist-in-android-studio/
太开心啦!AndroidStudio 真的比 Xcode 友好许多…至少每个按钮上都有悬浮提示…
我遇到的问题如下:
- Gradle sync 时显示不知道 node,所以需要用命令行方式打开 AndroidStudio 或写到 AndroidStudio 认识的 PATH 里
- 运行时闪退,可以直接看到依赖 sdk 的报错,原来是我在 MainActivity 里少写了一行 sdk 的初始化代码