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

Crash on UnityUtils.createPlayer

Open halileohalilei opened this issue 6 years ago • 5 comments

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:

screen shot 2019-02-17 at 17 35 38

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.

halileohalilei avatar Feb 17 '19 14:02 halileohalilei

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.

JanOwiesniak avatar Feb 19 '19 11:02 JanOwiesniak

Calling InitArgc properly fixed it:

https://github.com/f111fei/react-native-unity-demo/commit/56a0e149a17b31c55ea7c0002ebb3ae15807ed71#diff-e40e5631f2e9f07cae9e5e37e1d65bdaR18

ahmetardal avatar Apr 10 '19 21:04 ahmetardal

Calling InitArgc properly fixed it:

f111fei/react-native-unity-demo@56a0e14#diff-e40e5631f2e9f07cae9e5e37e1d65bdaR18

it works Why Calling InitArgc can fixed it

HiMelody avatar Dec 20 '19 07:12 HiMelody

@HiMelody I don't know.

ahmetardal avatar Dec 20 '19 10:12 ahmetardal

@HiMelody I don't know.

thanks

HiMelody avatar Dec 20 '19 10:12 HiMelody