async-storage: Doesn't run on Android with RN > 0.58
Current behavior
Running an app which includes AsyncStorage from this package instead of react-native
will crash the app on startup.
Expected behavior
It doesn’t crash the app on startup.
Repro steps
Just include the package with any RN > 0.58 (I think with all the gradle upgrades coming in 0.58 as well)
Environment
- Async Storage version: 1.2.1
- React-Native version: > 0.58
- Platform tested: Android only, iOS works fine
- Logs/Error that are relevant:
This is the log from the production device / emulator:
2019-03-20 16:21:35.950 9719-9742/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: com.bundlenam, PID: 9719
com.facebook.react.common.JavascriptException: null is not an object (evaluating 'l.multiMerge'), stack:
<unknown>@1436:2386
_@2:1514
d@2:967
o@2:435
<unknown>@1435:298
_@2:1514
d@2:967
o@2:435
<unknown>@1434:447
_@2:1514
d@2:967
o@2:435
<unknown>@1428:293
_@2:1514
d@2:967
o@2:435
<unknown>@1420:875
_@2:1514
d@2:967
o@2:435
<unknown>@1419:207
_@2:1514
d@2:967
o@2:435
<unknown>@1418:164
_@2:1514
d@2:967
o@2:435
<unknown>@1414:345
_@2:1514
d@2:967
o@2:435
<unknown>@1413:164
_@2:1514
d@2:967
o@2:435
<unknown>@358:416
_@2:1514
d@2:967
o@2:435
<unknown>@11:71
_@2:1514
d@2:897
o@2:435
global code@1618:4
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:764)
2019-03-20 16:24:15.347 9940-9963/? E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
Process: com.bundlename, PID: 9940
com.facebook.react.common.JavascriptException: null is not an object (evaluating 'l.multiMerge'), stack:
<unknown>@1436:2386
_@2:1514
d@2:967
o@2:435
<unknown>@1435:298
_@2:1514
d@2:967
o@2:435
<unknown>@1434:447
_@2:1514
d@2:967
o@2:435
<unknown>@1428:293
_@2:1514
d@2:967
o@2:435
<unknown>@1420:875
_@2:1514
d@2:967
o@2:435
<unknown>@1419:207
_@2:1514
d@2:967
o@2:435
<unknown>@1418:164
_@2:1514
d@2:967
o@2:435
<unknown>@1414:345
_@2:1514
d@2:967
o@2:435
<unknown>@1413:164
_@2:1514
d@2:967
o@2:435
<unknown>@358:416
_@2:1514
d@2:967
o@2:435
<unknown>@11:71
_@2:1514
d@2:897
o@2:435
global code@1618:4
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java:54)
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException(ExceptionsManagerModule.java:38)
at java.lang.reflect.Method.invoke(Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
at android.os.Looper.loop(Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192)
at java.lang.Thread.run(Thread.java:764)
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 19 (9 by maintainers)
Experiencing the same issue with RN0.59 running on a Nexus 5 emulator. Currently only using .setItem, .getItem and .removeItem.
Reverting back to import {AsyncStorage} from “react-native” for the moment.
I think I believe I found the issue.
Using auto link, react-native link : react-native link @react-native-community/async-storage
(in my code) has a bug and doesn’t add the code in the section protected List<ReactPackage> getPackages()
new AsyncStoragePackage()
in MainApplication.java
If you follow the manual way:
https://github.com/react-native-community/react-native-async-storage/blob/master/docs/Linking.md
…should be good to go:
@leandrosimoes
I’d need more info to know why it’s crashing