react-native-unity
react-native-unity copied to clipboard
UnityFramework was compiled with optimization - stepping may behave oddly; variables may not be available.
Error building iOS: UnityFramework was compiled with optimization - stepping may behave oddly; variables may not be available.
This issue occurs when running on iOS from Xcode. I have followed all the steps in the readme, and the project builds fine up until it tries to run on my phone which is when I get the following error:
This is a hard crash and the app does not run. I first encountered this about a month ago, and was able to workaround it by setting Optimization Level to "None" under Unity-iPhone > Targets > UnityFramework > Build Settings. However, this no longer seems to work and I cannot get it to work.
My Unity build settings & player settings that I image could be relevant are as follows:
- Run in Xcode as "Release"
- Development Build is NOT checked
- IL2CPP Code Generation set to Faster runtime
- Compression Method set to Default
- Strip Engine Code is unchecked
- Managed stripping level is Minimal
- Optimize mesh data is unchecked
Versions:
- React: 18.0.0
- React-native: 0.69.6
- Expo: 46.0.16
- Unity: 2021.3.10f1
- Xcode: 14.0.1
- iOS: 16.0.2
- iPhone 14 Pro Max
I have tried the following:
- Setting Optimization Level to "None" under Unity-iPhone > Targets > UnityFramework > Build Settings
- Trying builds with and without "Strip Engine Code" checked in Unity
- Setting Optimization Level to "None" under Unity-iPhone > Targets > Unity-iPhone > Build Settings
- Setting Optimization Level to "None" under Unity-iPhone > Project > Unity-iPhone > Build Settings
- Setting Optimization Level to "None" under [project name] > Project > [project name] > Build Settings
- Setting Optimization Level to "None" under [project name] > Target > [project name] > Build Settings
We have a deadline on the 7th and need to start testing - if anyone has any ideas here it would be much appreciated.
Thanks
I have gotten the app to run, but don't know why.
Steps to run:
- Build and install to phone like normal
- When it runs and automatically and crashes in Xcode, click the stop button in Xcode but leave the metro server running
- Hit r on the metro server terminal window to refresh
- App bundles and runs no problem - just no logs in Xcode
I would really like to get a proper fix for this. If anyone has any ideas on what might be going on here please shoot them my way.