joltup / react-native-threads

Create new JS processes for CPU intensive work
MIT License
755 stars 141 forks source link

UIManager could not be found Android with Hermes #100

Open mauriciopf opened 4 years ago

mauriciopf commented 4 years ago

For ThreadBaseReactPackage new UIManagerStubModule(catalystApplicationContext) doesn't seem to be working in RN 0.61

Is someone having this issue?

Image from iOS

manvi-ivnam commented 4 years ago

Hello, @mauriciopf! Just replace it with

import com.facebook.react.uimanager.UIManagerModule;
...
new UIManagerModule(catalystApplicationContext, createViewManagers(catalystApplicationContext), 0)
mboperator commented 4 years ago

Thanks @dobrynia

@mauriciopf , I ended up patching this file: https://github.com/joltup/react-native-threads/blob/master/android/src/main/java/com/reactlibrary/ThreadBaseReactPackage.java with what dobrynia recommended.

Then I used https://github.com/ds300/patch-package to create a patch file so I don't have to fork the repo.

Here's the resulting patch file: https://gist.github.com/mboperator/d20ee2ca2575aeda87f9b124b6b33c77

Hopefully it helps!