f111fei / react-native-unity-view

Show an unity view in react native
MIT License
402 stars 102 forks source link

Thread 1: EXC_BAD_ACCESS (code=1, address=0xa4) #131

Open jvetulani opened 4 years ago

jvetulani commented 4 years ago

Hi!

Having this issue while running on an iphone, when I press the Toggle Unity button from the example xcode throws this error.

Nothing in this thread helps: https://github.com/f111fei/react-native-unity-view/issues/84

I've added all the privacy permissions I can think of to info.plist, filled out their respective strings with the reason for the usage, also added the UnityCloudProjectID, nothing.

Tried on Unity 2018.2.17f1 and the current 2018 LTS version - 4.6f1, tried cleaning the project. Running it on an iPhoneX, building with an updated xCode10.1

edblokcer commented 4 years ago

Currently experiencing the exact same problem with iOS 12 and Unity 2019.1.14f1 / Vuforia 8.3.8. Error starts when the UnityPostMessage(gameObject, methodName, message); method has been called

blurxs commented 4 years ago

Same issue with Unity 2018.1.6f1, XCode 10.2.1, IOS 12.2

alisherakb commented 4 years ago

Currently experiencing the exact same problem with iOS 12 and Unity 2019.1.14f1 / Vuforia 8.3.8. Error starts when the UnityPostMessage(gameObject, methodName, message); method has been called

Are you sure that you sending three parameters? I've experienced the same when sending two parameters and then added third blank:

UnityModule.postMessage('ARWorldContentProvider', 'CreatePost', '')

Hope this helps.

edblokcer commented 4 years ago

Currently experiencing the exact same problem with iOS 12 and Unity 2019.1.14f1 / Vuforia 8.3.8. Error starts when the UnityPostMessage(gameObject, methodName, message); method has been called

Are you sure that you sending three parameters? I've experienced the same when sending two parameters and then added third blank:

UnityModule.postMessage('ARWorldContentProvider', 'CreatePost', '')

Hope this helps.

Thanks for your reply. From the Javascript code it's being triggered by UnityModule.postMessage('ARCamera', 'InitVuforia'), which has been working till I updated React Native and Unity. What would you suggest adding as a third parameter?

An addition to this is that it's working without UnityModule.postMessage('ARCamera', 'InitVuforia') and delayed initialization of Vuforia as setting from Unity.

edblokcer commented 4 years ago

Misread it a little and added an empty string as the third parameter which indeed solved the problem. Thanks @alisherakb!