Error throwing while upgrading expo sdk from version 40.0.0 to 44.0.0

Please provide the following:

  1. SDK Version:40.0.0
  2. Platforms(Android/iOS/web/all):all
  3. Add the appropriate “Tag” based on what Expo library you have a question on.
    Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null

Currently our app is running on expo sdk version 40.0.0 and trying to upgrade to the latest version of expo, during upgrading when I am running the project in android simulator I am getting following error:

++++++++++++++++++
Error: [@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.

To fix this issue try these steps:

• Run react-native link @react-native-community/async-storage in the project root.

• Rebuild and restart the app.

• Run the packager with --reset-cache flag.

• If you are using CocoaPods on iOS, run pod install in the ios directory and then rebuild and re-run the app.

• If this happens while testing with Jest, check out docs how to integrate AsyncStorage with it: https://react-native-community.github.io/async-storage/docs/advanced/jest
+++++++++++++++++++++++
I have tried all steps mentioned above but nothing worked, please help to resolve the issue.

Error during upgrade|690x164
I am stuck and unable to upgrade my app, please help so that I can move ahead and successfully upgrade the app.

Thanks

Hey @sbi-webteam, we recommend upgrading one SDK version at a time and make sure you read about the breaking changes for each SDK. I would revert your changes to a previous commit and then go with the incremental approach.

2 Likes

I am doing the same my app was on version 39.0.0, I have successfully upgraded it to version 40.0.0 and now I am trying to upgrade to next 41.0.0, my goal is to upgrade it to the latest, and while upgrading I am getting the above error. Please help to that I can get rid of the error and able to upgrade my app. I have upgraded @react-native-community/async-storage to @react-native-async-storage/async-storage as well.
Currently I am trying to run my app in android simulator.

Thanks

Hi @sbi-webteam

Could you show us your dependencies and some of the AsyncStorage imports and code?

Hello
Sorry for delay in reply but somehow I got success to upgrade my app into version 41.0.0 now I am moving next (42.0.0) and again I am started facing same issue, I have applied all those options that I opt to update app from 40.0.0 to 41.0.0 but still getting same error. Please review my package.json file:

Package.json(code)

{
“name”: “merchant-app”,
“version”: “5.1.0”,
“private”: true,
“scripts”: {
“build:android”: “expo-cli build:android --release-channel=1.5 --no-publish”,
“build:ios”: “expo-cli build:ios --release-channel=1.5 --no-publish”,
“devtools”: “react-devtools”,
“start:dev”: “expo-cli start”,
“android”: “expo run:android”,
“ios”: “expo run:ios”,
“test”: “jest --watch”,
“test-once”: “node ./node_modules/jest/bin/jest.js”,
“flow”: “flow; test $? -eq 0 -o $? -eq 2”,
“prepush”: “yarn test-once”,
“postinstall”: “node create-app-json”,
“start”: “expo start --dev-client”
},
“jest”: {
“preset”: “jest-expo”,
“setupFiles”: [
“./jestSetupFile.js”
],
“testEnvironment”: “node”,
“testMatch”: [
“**/?(*.)(spec|test).js?(x)”
],
“testResultsProcessor”: “./node_modules/jest-bamboo-formatter”,
“transformIgnorePatterns”: [
“/abc/”
]
},
“dependencies”: {
@aspnet/signalr”: “^1.1.4”,
@babel/plugin-proposal-class-properties”: “^7.1.0”,
@expo/react-native-action-sheet”: “^3.3.2”,
@react-native-async-storage/async-storage”: “~1.15.0”,
“async-mutex”: “^0.1.4”,
“date-fns”: “^1.28.4”,
“delay”: “^4.3.0”,
“dotenv”: “^7.0.0”,
“emoji-utils”: “^1.0.1”,
“expo”: “^42.0.0”,
“expo-asset”: “~8.3.3”,
“expo-auth-session”: “~3.3.1”,
“expo-av”: “~9.2.3”,
“expo-background-fetch”: “~9.2.2”,
“expo-barcode-scanner”: “~10.2.2”,
“expo-camera”: “~11.2.2”,
“expo-constants”: “~11.0.1”,
“expo-device”: “~3.3.0”,
“expo-file-system”: “~11.1.3”,
“expo-font”: “~9.2.1”,
“expo-image-manipulator”: “~9.2.2”,
“expo-image-picker”: “~10.2.2”,
“expo-linking”: “~2.3.1”,
“expo-location”: “~12.1.2”,
“expo-media-library”: “~12.1.2”,
“expo-modules-autolinking”: “^0.5.5”,
“expo-notifications”: “~0.12.3”,
“expo-permissions”: “~12.1.1”,
“expo-random”: “~11.2.0”,
“expo-screen-orientation”: “~3.3.0”,
“expo-splash-screen”: “~0.11.2”,
“expo-status-bar”: “~1.0.4”,
“expo-task-manager”: “~9.2.2”,
“expo-updates”: “~0.8.1”,
“expo-web-browser”: “~9.2.0”,
“git-repo-info”: “^1.4.1”,
“immer”: “^1.2.1”,
“is-image”: “^2.0.0”,
“jwt-decode”: “^2.2.0”,
“lodash”: “^4.17.5”,
“moment”: “^2.20.1”,
“p-cancelable”: “^2.0.0”,
“p-queue”: “3.0.0”,
“p-retry”: “^2.0.0”,
“path”: “^0.12.7”,
“prop-types”: “^15.5.10”,
“query-string”: “^5.0.1”,
“react”: “16.13.1”,
“react-devtools”: “^3.1.0”,
“react-dom”: “16.13.1”,
“react-native”: “~0.63.4”,
“react-native-calendar-picker”: “^5.11.0”,
“react-native-communications”: “^2.2.1”,
“react-native-dialog”: “^5.6.0”,
“react-native-dropdownalert”: “^4.2.0”,
“react-native-elements”: “^1.2.7”,
“react-native-gesture-handler”: “~1.10.2”,
“react-native-gifted-chat”: “^0.11.3”,
“react-native-keyboard-aware-scroll-view”: “^0.9.1”,
“react-native-lightbox”: “^0.8.0”,
“react-native-material-ui”: “2.0.0-alpha.1”,
“react-native-modal”: “^11.5.3”,
“react-native-offline”: “^5.2.0”,
“react-native-photo-browser”: “^0.5.0”,
“react-native-reanimated”: “~2.2.0”,
“react-native-screens”: “~3.4.0”,
“react-native-select-multiple”: “^2.1.0”,
“react-native-side-menu”: “^1.1.3”,
“react-native-snap-carousel”: “^3.8.4”,
“react-native-status-bar-size”: “^0.3.2”,
“react-native-swipeout”: “^2.3.3”,
“react-native-unimodules”: “0.14.10”,
“react-native-web”: “~0.13.12”,
“react-native-webview”: “11.6.2”,
“react-redux”: “^7.1.3”,
“react-router-native”: “^4.2.0”,
“redux”: “^3.7.2”,
“redux-storage”: “^4.1.2”,
“redux-storage-decorator-filter”: “^1.1.8”,
“redux-storage-engine-reactnativeasyncstorage”: “^1.0.5”,
“redux-thunk”: “^2.2.0”,
“s-ago”: “^1.1.0”,
“semver”: “^5.6.0”,
“uuid”: “^3.1.0”
},
“devDependencies”: {
@babel/core”: “~7.9.0”,
“babel-jest”: “^22.1.0”,
“babel-preset-expo”: “8.3.0”,
“babel-preset-latest”: “^6.24.1”,
“babel-preset-stage-0”: “^6.24.1”,
“cross-env”: “^5.1.4”,
“flow-bin”: “^0.112.0”,
“husky”: “^0.14.3”,
“jest”: “^28.0.2”,
“jest-bamboo-formatter”: “^1.0.1”,
“jest-expo”: “^42.0.1”,
“npm-run-all”: “^4.1.2”,
“prettier”: “^1.19.1”,
“react-test-renderer”: “16.5.0”,
“redux-mock-store”: “^1.4.0”,
“redux-testkit”: “^1.0.6”
}
}

***********jestSetupFile
import mockAsyncStorage from ‘@react-native-async-storage/async-storage/jest/async-storage-mock’;

jest.mock(’@react-native-async-storage/async-storage’, () => mockAsyncStorage);

Please review and guide me so that I can get rid of above error.

Thanks!