react-native: java.lang.NoClassDefFoundError: com.facebook.react.jscexecutor.JSCExecutor
Description
Version
0.71.1
Output of npx react-native info
info Fetching system and libraries information… System: OS: Windows 10 10.0.22000 CPU: (12) x64 Intel® Core™ i5-10400 CPU @ 2.90GHz Memory: 2.54 GB / 15.75 GB Binaries: Node: 16.15.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.11 - ~\AppData\Roaming\npm\yarn.CMD npm: 7.22.0 - ~\AppData\Roaming\npm\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: AI-213.7172.25.2113.9123335 Visual Studio: Not Found Languages: Java: 11.0.13 - C:\Program Files\Android\Android Studio\jre\bin\javac.EXE npmPackages: @react-native-community/cli: Not Found react: 18.2.0 => 18.2.0 react-native: ^0.71.1 => 0.71.1 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
Integration with Existing Apps,First jump AppletActivity no problem,Return to the previous activity,Second jump AppletActivity Errors
Snack, code example, screenshot, or link to a repository
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (3 by maintainers)
I had this issue and I solved it by calling
.setJavaScriptExecutorFactory(HermesExecutorFactory())
on the object returned byReactInstanceManager.builder()
. This works if you’re usingHermes
@sanjeevyadavIT in your case, because you’ve overriding the
ReactNativeHost
, you can specify theHermesExecutorFactory()
like this:This worked for me also for those still facing issue on 0.71.2
This worked more me.
As mentioned, the problem is that you’re not creating a
ReactInstanceManager
correctly. That’s how theReactNativeHost
is doing it:https://github.com/facebook/react-native/blob/6439baaca12f844b2192740bbaa5ee61edcba608/ReactAndroid/src/main/java/com/facebook/react/ReactNativeHost.java#L69-L84
You should either follow this pattern or use
DefaultReactNativeHost
as the template is doing which simplifies this setup for yousame problem
were you able to fix it?