饭疏食饮水

发布于     更新于
React Native 开发记录

子曰:“饭疏食饮水,曲肱而枕之,乐亦在其中矣。不义而富且贵,于我如浮云。”

基于 ReactNative 生态开发移动应用的踩坑记录。

文档

路由

UI 库

LibraryDocumentation
React Native PaperLink
React Native UI LibLink
React Native ElementsLink
NativeBaseLink
React Native UI KittenLink
React Native iOS KitLink
Fluent UILink
TamaguiLink

推荐的库

Our mission is to provide a full suite of well-integrated components built with Material Design in mind. However, many components already have better well maintained implementations.

Here are some of the libraries we recommend:

Tabs

react-native-community/react-native-tab-view Material Design themed swipeable tabs, maintained by @satya164 and @mosdnk.

react-native-paper-tabs Material Design themed swipeable tabs for React Native Paper, maintained by @RichardLindhout

Bottom sheet

osdnk/reanimated-bottom-sheet An implementation of the bottom sheet behaviour, maintained by @mosdnk.

gorhom/react-native-bottom-sheet An implementation of the bottom sheet behaviour, maintained by @Gorhom.

Date Picker

web-ridge/react-native-paper-dates Material Design themed date picker, maintained by @RichardLindhout react-native-community/react-native-datetimepicker

Time Picker

web-ridge/react-native-paper-dates Material Design themed time picker, maintained by @RichardLindhout

System Colors

pchmn/expo-material3-theme Retrieve Material 3 system colors from Android 12+ devices

其他:

调试:

winget install openssl
choco install watchman

常用命令:

{
    "build-ios": "eas build -p ios --profile preview --clear-cache",
    "build-apk": "cd android && sh ./gradlew assembleRelease "
}
  • 生成 APK
cd android
./gradlew assembleRelease
  • 生成 AAB
cd android
./gradlew bundleRelease
  • 测试应用
npx react-native run-android --variant=release
  • 预构建
npx expo prebuild
  • eas 构建
npx eas build -p ios --profile development
npx eas build -p android --profile development
  • eas ios 模拟器
npx eas build -p ios --profile development
  • iOS 清理缓存
npx expo prebuild
cd ios
bundle install
bundle exec pod install
cd ios && rm -rf Pods && rm -rf build && pod cache clean --all && pod install && cd ..
  • iOS 本地打包
npx react-native run-ios --configuration=release   --verbose
npx expo run:ios --configuration Release
  • eas 本地打包
eas build -p ios --profile preview --clear-cache --local
  • eas 添加设备
//  eas device:create
  • 解决重复下载依赖
copy .\\android_download\\* .\\node_modules\\expo-modules-core\\android\\build\\downloads