❧ Expo搭建移动端
1. 安装
npx create-expo-app@latest2. 运行
npm run android3. 登录Expo
npx expo login4. 生成配置文件eas.json
npx eas build:configure5. 打包
npx eas build --platform android# 打包apknpx eas build -p android --profile preview6. 预构建设置(减小打包体积)
方法一:
npx expo install expo-build-properties会生成一个 app.json 文件,
方法二:
npx expo prebuild -p android打开grade.properties文件,修改 expo.useLegacyPackaging 为 true
不推荐使用该方法,会生成android目录的裸项目,无法使用expo的工作流
注意事项:
- 使用手势监听时
GestureHandlerRootView必须添加到screen层级的文件中