react-native-unity-view | Integrate unity3d within a React Native app | iOS library
kandi X-RAY | react-native-unity-view Summary
kandi X-RAY | react-native-unity-view Summary
Integrate unity3d within a React Native app. Add a react native component to show unity. Works on both iOS and Android.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-native-unity-view
react-native-unity-view Key Features
react-native-unity-view Examples and Code Snippets
Community Discussions
Trending Discussions on react-native-unity-view
QUESTION
I'm a React Native noob.
I just integrated my Unity3D app with the React Native app using nreact-native-unity-view
(https://github.com/nhancv/nreact-native-unity-view)
ANSWER
Answered 2020-Oct-11 at 18:07The easiest way is to use the stack navigator and have a separate page for the unity screen. https://reactnavigation.org/docs/stack-navigator/
the code to navigate would be navigation.navigate('screenname'); This code wont work until you sort the imports related to unity and related items.
QUESTION
We have a ReactNative application that has integrated Unity based on react-native-unity-view successfully as a library for quite a long time. However, after most recent updates on ReactNative regarding AndroidX and latest SDK-changes, we're running into the issue "libmain.so not found". This exception happens on the very first attempt to display a Unity-View.
There is a similar issue on SO, please don't mark as duplicate as our approach might be different and particulary since we give many many more details here.
There is a running and still working example on GitHub (based on ReactNative 0.57): https://github.com/f111fei/react-native-unity-demo. As long as this project is based on ReactNative 0.57 and its appropriate gradle-settings, everything works fine. But as soon as we upgrade to the latest ReactNative version (and even 0.60 for example), which gives us an android-folder that is very different against to the older one), the issue happens with a crash of the application. (We also tried to set up everything from scratch to exclude the possibility that this issue was due to upgrades. With RN 0.57 everything still works fine, with RN 0.60 and above not)
The exception is as follows:
...ANSWER
Answered 2019-Nov-21 at 16:33I can answer by myself now. The issue was caused by Unity export that was not ARM64-compatible unless several settings were applied manually. Here is how:
Bevor building for Android, we need to adjust some settings in "Player Settings" in order to make ARM64 available:
- Switching "Scripting Backend" from Mono to ILCPP, which enables us to:
- Select "ARM64" under Target Architectures
If you run into an Error like "NDK not found" while building, ensure that Unity has downloaded and installed its own copy of NDK:
Having all this in mind will enable us to link against these libraries without failing to find "libmain.so".
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-native-unity-view
Add the following to the android/build.gradle
Add these two lines to android/settings.gradle
Open your ios/{PRODUCT_NAME}.xcworkspace and add the exported project(ios/UnityExport/Unity-Iphone.xcodeproj) to the workspace root
Select the Unity-iPhone/Data folder and change the Target Membership to UnityFramework
Add UnityFramework.framework as a library to your Project
Modify main.m
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page