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

UnityFramework was compiled with optimization - stepping may behave oddly; variables may not be available.

Open wolfdavo opened this issue 3 years ago • 1 comments

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:

Screenshot 2022-10-31 at 8 06 04 PM

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:

  1. Setting Optimization Level to "None" under Unity-iPhone > Targets > UnityFramework > Build Settings
  2. Trying builds with and without "Strip Engine Code" checked in Unity
  3. Setting Optimization Level to "None" under Unity-iPhone > Targets > Unity-iPhone > Build Settings
  4. Setting Optimization Level to "None" under Unity-iPhone > Project > Unity-iPhone > Build Settings
  5. Setting Optimization Level to "None" under [project name] > Project > [project name] > Build Settings
  6. 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

wolfdavo avatar Nov 01 '22 03:11 wolfdavo

I have gotten the app to run, but don't know why.

Steps to run:

  1. Build and install to phone like normal
  2. When it runs and automatically and crashes in Xcode, click the stop button in Xcode but leave the metro server running
  3. Hit r on the metro server terminal window to refresh
  4. 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.

wolfdavo avatar Nov 01 '22 04:11 wolfdavo