Showing Recent Messages File /Us
2022-05-13 本文已影响0人
物联白菜

解决两步:
一、生成main.jsbundle文件
二、添加到项目依赖里
具体步骤如下:
1、生成main.jsbundle文件,在终端项目目录下执行:
react-native bundle --entry-file index.js --bundle-output ./ios/main.jsbundle --platform ios --assets-dest ./ios --dev false
或在 package.json 里面添加以下执行命令,终端执行yarn buildios即可生成main.jsbundle文件:
"buildios":"react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
生成后,原先的main.jsbundle应该是从红色变为如下图的灰色样子

2、然后在TARGES 找到这里并添加,然后重新打包就可以了
