react-native-unity-view
react-native-unity-view copied to clipboard
Crash on UnityUtils.createPlayer
I was using a fork of this library, but decided to catch up with the latest release. I updated the library and tried to run it on iOS, but I'm getting this crash on UnityUtils.createPlayer
. Here is the stack trace of the crash:

The fork I was using had no changes on the iOS side, so it should be as if I'm just trying to upgrade my dependency from version 1.0.4 to 1.3.3. Any ideas why this may be happening?
I'm using Unity 2018.2.8f1, Xcode 10.1, and trying to run on an iPhone SE with iOS 12.1.4. I can provide more information regarding the project if needed.
good to know
I'm using react-navigation to navigate through my app.
issue
I was calling UnityModule.createUnity
on Screen A and showing an animation to give unity some time to do it's stuff. After the animation was completed and unity was created i switched to Screen B to actually render the unity scene via UnityView
.
The app crashed immediately.
my workaround
Create UnityView
automagically during render()
and do not share UnityView
across multiple screens.
Calling InitArgc
properly fixed it:
https://github.com/f111fei/react-native-unity-demo/commit/56a0e149a17b31c55ea7c0002ebb3ae15807ed71#diff-e40e5631f2e9f07cae9e5e37e1d65bdaR18
Calling
InitArgc
properly fixed it:f111fei/react-native-unity-demo@56a0e14#diff-e40e5631f2e9f07cae9e5e37e1d65bdaR18
it works Why Calling InitArgc can fixed it
@HiMelody I don't know.
@HiMelody I don't know.
thanks