async-storage: Undefined is not an object (evaluating 'RCTAsyncStorage.multiMerge')


This issue was originally created by @boreales as facebook/react-native#22556.


Environment

React Native Environment Info: System: OS: macOS 10.14.1 CPU: (8) x64 Intel® Core™ i7-7700HQ CPU @ 2.80GHz Memory: 463.56 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 9.5.0 - /usr/local/bin/node npm: 6.4.1 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: API Levels: 26, 27 Build Tools: 27.0.3 System Images: android-27 | Google Play Intel x86 Atom IDEs: Android Studio: 3.1 AI-173.4907809 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.5.0 => 16.5.0 react-native: https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz => 0.57.1 npmGlobalPackages: create-react-native-app: 2.0.2 react-native-cli: 2.0.1

Description

image

Reproducible Demo

// Store/configureStore.js

import { createStore } from 'redux'
import toggleFavorite from './reducers/favoriteReducer'
import setAvatar from './reducers/avatarReducer'
import { persistCombineReducers } from 'redux-persist'
import storage from 'redux-persist/lib/storage'

const rootPersistConfig = {
  key: 'root',
  storage: storage
}

export default createStore(persistCombineReducers(rootPersistConfig, {toggleFavorite, setAvatar}))

The problem seems to be the same as #21948 but I have last react-native version and can’t fix it anyway. Any idea ?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 28 (10 by maintainers)

Commits related to this issue

Most upvoted comments

In react-native 0.59 this happens only in android for me, ios runs fine.

In react-native 0.59, this happens in android even if you don’t use mergeItem or multiMerge

I noticed the below error in my project console:

console.error: React Native version mismatch.

JavaScript version: 0.62.3
Native version: 0.71.0-rc.0

Resolved this issue by fixing the version mismatch.

@Krizzu sorry i could not reproduce outside my own project. Indeed i forgot to run react-native link as @JeffreyHyer said. In my case, the link command did not add new AsyncStoragePackage() to MainApplication.java so i had to do it manually and now it’s working fine in Android and IOS.

I had the same issue after migrating an app to 0.59.0 and importing this package instead of the one bundled with react-native core. It worked fine on iOS - no crashes and the async storage seemed to function normally (probably it used the version bundled with RN somehow) but crashed on Android with this error.

The problem was that I forgot to link the module:

./node_modules/.bin/react-native link @react-native-community/async-storage