Stuck a few days already, please help!!
I have tested my app with expo start in dev mode, and it worked perfectly for both iOS and Android. However, when I tried with expo build:android, the apk would crashed for some specific sequence of actions.
To debug, I used: “expo start --no-dev --minify” to mimic production and then tested it on the Android Studio simulator. It also failed.
But if I do “expo start --no-dev --no-minify” it worked!
These observation together with the following message from the Android simulator log:
*11-29 14:56:00.340 10135 7263 7419 E ReactNativeJS: Error: Requiring unknown module “undefined”.
seems to imply something wrong with the module dependencies not being captured properly.
The culprit is likely the react-native-calendar module, because when the fetched data results in some visual changes (in this case showing some dots on the date cell), it would crash.
Here is the expo diagnostics:
Expo CLI 4.0.3 environment info:
System:
OS: Windows 10 10.0.19041
Binaries:
Node: 12.19.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 4.1.0.0 AI-201.8743.12.41.6953283
npmPackages:
expo: ^37.0.0 => 37.0.12
react: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz => 0.61.4
react-navigation: 1.5.13 => 1.5.13
Expo Workflow: managed
And here is my package.json:
{
“main”: “node_modules/expo/AppEntry.js”,
“private”: true,
“scripts”: {
“test”: “node ./node_modules/jest/bin/jest.js --watch”
},
“jest”: {
“preset”: “jest-expo”
},
“dependencies”: {
“@react-native-community/datetimepicker”: “2.2.2”,
“axios”: “^0.21.0”,
“ex-react-native-i18n”: “^0.0.6”,
“expo”: “^37.0.0”,
“expo-asset”: “~8.1.5”,
“expo-av”: “~8.1.0”,
“expo-font”: “~8.1.0”,
“libphonenumber-js”: “^1.8.7”,
“node”: “12.14.0”,
“npm”: “^6.10.0”,
“react”: “16.9.0”,
“react-native”: “https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz”,
“react-native-blink-view”: “^0.0.6”,
“react-native-calendars”: “^1.491.0”,
“react-native-datepicker”: “^1.7.2”,
“react-native-elements”: “3.0.0-alpha.1”,
“react-native-image-resizer”: “^1.3.0”,
“react-native-modal”: “^11.5.6”,
“react-native-modal-dropdown”: “0.7.0”,
“react-native-table-component”: “^1.2.1”,
“react-native-timeline-flatlist”: “^0.6.5”,
“react-native-timeline-listview”: “^0.2.3”,
“react-navigation”: “1.5.13”,
“react-redux”: “^5.0.6”,
“redux”: “^3.7.2”,
“redux-persist”: “<5.0.0”,
“redux-thunk”: “^2.2.0”
},
“devDependencies”: {
“eslint-config-rallycoding”: “^3.1.0”,
“jest-expo”: “^37.0.0”
}
}