I created a new React Native app using the CLI with the boilerplate template. The resulting iOS app size in release mode is unexpectedly large: 511.9 MB. Normally I would expect a new React Native app to be less than 10 MB. This large app size seems to be a recent change. What am I not considering? Thanks in advance!
Steps taken:
- npm uninstall -g react-native-cli @react-native-community/cli
- npx react-native@latest init TestProject
- Open /ios/TestProject.xcworkspace in Xcode
- Go to Test Project > Edit Scheme
- Change build configuration to Release and uncheck Debug Executable
- Close popup window
- Push run button to run the app on my connected device
- On the iPhone, check Settings > General > iPhone Storage
- The newly installed app shows that it is using 511.9 MB of space
Other steps I tried:
- In XCode, click Product > Archive.
- In the Organizer window, right-click the app and click Show in Finder
- The resulting app size on the file system is 544.8 MB
My environment:
- macOS: Ventura 13.2.1
- Xcode: 14.2 (14C18)
- Node: 18.15.0
- Ruby: 2.7.6p219
Project package.json (from the boilerplate template)
{
"name": "TestProject",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"react": "18.2.0",
"react-native": "0.71.4"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native-community/eslint-config": "^3.2.0",
"@tsconfig/react-native": "^2.0.2",
"@types/jest": "^29.2.1",
"@types/react": "^18.0.24",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
"eslint": "^8.19.0",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "0.73.8",
"prettier": "^2.4.1",
"react-test-renderer": "18.2.0",
"typescript": "4.8.4"
},
"jest": {
"preset": "react-native"
}
}