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

ERROR Invariant Violation: requireNativeComponent: "RNUnityView" was not found in the UIManager.

Open Ginushmal opened this issue 1 year ago • 6 comments

Im trying to test out the Unity integration to React with just a simple unity project . Im using Expo with React and just created a single simple page following tutorial. I tried this s with one tutorial and met the same issue and then for a change I followed another tutorial . Still get the same error And I'm Building this for Android , And i cant find any working solution, can someone help me .

`ERROR Invariant Violation: requireNativeComponent: "RNUnityView" was not found in the UIManager.

This error is located at: in RNUnityView (created by UnityView) in UnityView (created by UnityAndRn) in RCTView (created by View) in View (created by UnityAndRn) in UnityAndRn (created by HomeScreen) in RCTView (created by View) in View (created by HomeScreen) in HomeScreen in Unknown (created by Route(index)) in Suspense (created by Route(index)) in Route (created by Route(index)) in Route(index) (created by SceneView) in StaticContainer in EnsureSingleNavigator (created by SceneView) in SceneView (created by BottomTabView) in RCTView (created by View) in View (created by Screen) in RCTView (created by View) in View (created by Background) in Background (created by Screen) in Screen (created by BottomTabView) in RNSScreen (created by Animated(Anonymous)) in Animated(Anonymous) (created by InnerScreen) in Suspender (created by Freeze) in Suspense (created by Freeze) in Freeze (created by DelayedFreeze) in DelayedFreeze (created by InnerScreen) in InnerScreen (created by Screen) in Screen (created by MaybeScreen) in MaybeScreen (created by BottomTabView) in RNSScreenContainer (created by ScreenContainer) in ScreenContainer (created by MaybeScreenContainer) in MaybeScreenContainer (created by BottomTabView) in RCTView (created by View) in View (created by SafeAreaProviderCompat) in SafeAreaProviderCompat (created by BottomTabView) in BottomTabView (created by BottomTabNavigator) in PreventRemoveProvider (created by NavigationContent) in NavigationContent in Unknown (created by BottomTabNavigator) in BottomTabNavigator in Unknown (created by TabLayout) in TabLayout in Unknown (created by Route((tabs))) in Suspense (created by Route((tabs))) in Route (created by Route((tabs))) in Route((tabs)) (created by SceneView) in StaticContainer in EnsureSingleNavigator (created by SceneView) in SceneView (created by SceneView) in RCTView (created by View) in View (created by DebugContainer) in DebugContainer (created by MaybeNestedStack) in MaybeNestedStack (created by SceneView) in RCTView (created by View) in View (created by SceneView) in RNSScreen (created by Animated(Anonymous)) in Animated(Anonymous) (created by InnerScreen) in Suspender (created by Freeze) in Suspense (created by Freeze) in Freeze (created by DelayedFreeze) in DelayedFreeze (created by InnerScreen) in InnerScreen (created by Screen) in Screen (created by SceneView) in SceneView (created by NativeStackViewInner) in Suspender (created by Freeze) in Suspense (created by Freeze) in Freeze (created by DelayedFreeze) in DelayedFreeze (created by ScreenStack) in RNSScreenStack (created by ScreenStack) in ScreenStack (created by NativeStackViewInner) in NativeStackViewInner (created by NativeStackView) in RCTView (created by View) in View (created by SafeAreaProviderCompat) in SafeAreaProviderCompat (created by NativeStackView) in NativeStackView (created by NativeStackNavigator) in PreventRemoveProvider (created by NavigationContent) in NavigationContent in Unknown (created by NativeStackNavigator) in NativeStackNavigator in Unknown (created by RootLayout) in ThemeProvider (created by RootLayout) in RootLayout in Unknown (created by Route()) in Suspense (created by Route()) in Route (created by Route()) in Route() (created by ContextNavigator) in RNCSafeAreaProvider (created by SafeAreaProvider) in SafeAreaProvider (created by wrapper) in wrapper (created by ContextNavigator) in EnsureSingleNavigator in BaseNavigationContainer in ThemeProvider in NavigationContainerInner (created by ContextNavigator) in ContextNavigator (created by ExpoRoot) in ExpoRoot (created by App) in App (created by ErrorOverlay) in ErrorToastContainer (created by ErrorOverlay) in ErrorOverlay (created by withDevTools(ErrorOverlay)) in withDevTools(ErrorOverlay) in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer in main(RootComponent), js engine: hermes`

Ginushmal avatar Jun 22 '24 13:06 Ginushmal

I have exactly the same problem.

kynesss avatar Jun 24 '24 12:06 kynesss

help me too

IvaAMarinova avatar Jun 25 '24 07:06 IvaAMarinova

The only way I got this to work is to do an Expo prebuild, then follow the steps outlined in the documentation for Android. Seems like the package is not ready for Expo yet.

darrench3140 avatar Jul 30 '24 16:07 darrench3140

try npx pod-install on iOS.

dw8869 avatar Aug 09 '24 09:08 dw8869

Seems like the package is not ready for Expo yet.

I guess you mean Expo Go. This package cannot and will never work with Expo Go, as the Unity library is native code that needs to be linked into a custom native build, requiring compilation.

s-ol avatar Jan 09 '25 11:01 s-ol

I resolved this in IOS by,

XCode -> Build Phases -> Link Binary with Libraries -> + icon -> search unity and find something like react_native_unity.framework inside Pods -> Add -> Add anyway

Gugan-Ananth-A avatar Jul 04 '25 22:07 Gugan-Ananth-A