Skip to content

[Android] Should Initialize MMKV from MainActivity #12

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

keShraa
Copy link
Contributor

@keShraa keShraa commented Oct 25, 2021

[ANDROID] Removed setupLibrary (MMKV.initialize method) from React Native logic.

Now you should init MMKV from your own MainActivity file and don't forget to import implementation 'com.tencent:mmkv-static:1.2.10' in your app/build.gradle

By doing so, we are trying to avoid a crash caused by the MMKV.initialize method.

Fatal Exception: java.lang.RuntimeException: Could not invoke RNFastStorage.setupLibrary

   at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:383)
   at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:151)
   at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
   at android.os.Handler.handleCallback(Handler.java:873)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
   at android.os.Looper.loop(Looper.java:214)
   at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:226)
   at java.lang.Thread.run(Thread.java:764)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant