react-native-v8 icon indicating copy to clipboard operation
react-native-v8 copied to clipboard

react native v0.66.3 with reanimated not supported

Open arasrezaei opened this issue 2 years ago • 7 comments

Hi there, thanks for this great package, I tried to test reanimated with V8 but it crushes the app while opening:

FATAL EXCEPTION: create_react_context

java.lang.UnsatisfiedLinkError: dlopen failed: library "libjsc.so" not found

FATAL EXCEPTION: create_react_context
Process: com.qplusv8, PID: 6281
java.lang.UnsatisfiedLinkError: dlopen failed: library "libjsc.so" not found
	at java.lang.Runtime.loadLibrary0(Runtime.java:990)
	at java.lang.System.loadLibrary(System.java:1562)
	at com.swmansion.reanimated.NativeProxy.<clinit>(NativeProxy.java:23)
	at com.swmansion.reanimated.NodesManager.initWithContext(NodesManager.java:138)
	at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:18)
	at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1336)
	at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136)
	at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1065)
	at java.lang.Thread.run(Thread.java:761)

I also tried your fork of reanimared (with changing reanimated arr from v0.65 to 0.66 :)) and this time got this error this time:

FATAL EXCEPTION: create_react_context

java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN8facebook15createV8RuntimeERKNSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE" referenced by "/data/app/com.qplusv8-1/lib/x86/libreanimated.so"...

FATAL EXCEPTION: create_react_context
Process: com.qplusv8, PID: 7478
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN8facebook15createV8RuntimeERKNSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE" referenced by "/data/app/com.qplusv8-1/lib/x86/libreanimated.so"...
	at java.lang.Runtime.loadLibrary0(Runtime.java:990)
	at java.lang.System.loadLibrary(System.java:1562)
	at com.swmansion.reanimated.NativeProxy.<clinit>(NativeProxy.java:22)
	at com.swmansion.reanimated.NodesManager.initWithContext(NodesManager.java:127)
	at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:18)
	at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1336)
	at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136)
	at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1065)
	at java.lang.Thread.run(Thread.java:761)

is it possible to fix this?

arasrezaei avatar Nov 19 '21 00:11 arasrezaei

Try removing exclude "**/libjsc.so" from your android/app/build.gradle

RodolfoGS avatar Nov 30 '21 03:11 RodolfoGS

Try removing exclude "**/libjsc.so" from your android/app/build.gradle

Thanks, but with this method Javascript thread runs with V8 and for example reanimated worklets run with JSC. (Am I right?) And having two engines will result in a large app size!

arasrezaei avatar Dec 02 '21 06:12 arasrezaei

I got the same exact error but with v0.65 of react-native-v8. Any help appreciated!

jzxchiang1 avatar Dec 02 '21 06:12 jzxchiang1

@Kudo Do you know how to solve this? Thanks

RodolfoGS avatar Dec 07 '21 02:12 RodolfoGS

@Kudo I have already made the necessary changes here: https://github.com/lkinasiewicz/react-native-reanimated/commits/v8/2.3.1 - the last two commits. Please let me know if you can create v8/2.3.1 branch in your repo so that I can make a pull request, or you can just cherry-pick my changes. I have tested this with RN 0.66.3 and works on Android (v8), Android TV (v8) and iOS (jsc). 0.65.2 should also work, but I haven't checked.

If anybody needs it now, you can use it this way:

  • clone my repo
  • make sure that you have wget, gradle and other android tools installed
  • run yarn
  • run ./createNPMPackage.sh
  • move the generated tar archive wherever you want and add it to your project, e.g. from your project's directory: yarn add ./react-native-reanimated-2.3.1.tgz; yarn

lkinasiewicz avatar Jan 25 '22 18:01 lkinasiewicz

This is so painful to keep react-native, react-native-reanimated, and react-native-v8 all in sync.

I hope the reanimated team can officially support v8 soon. It's been months and haven't heard anything..

jzxchiang1 avatar Feb 16 '22 06:02 jzxchiang1

0.67 just got published - has anyone tried to see if it works with reanimated?

jzxchiang1 avatar Mar 16 '22 03:03 jzxchiang1