Project Name' Was Compiled with Optimization - Stepping May Behave Oddly; Variables May Not Be Available

Project Name' was compiled with optimization - stepping may behave oddly; variables may not be available

It's been a long time but I finally solved the issue. There is a third optimization flag LTO or Link Time Optimization and Surprisingly no one have
mentioned it here and for some reason I didn't pay attention to it either. It's right there above the Optimization Level setting as you can see in many screen shots posted here.

So to summarize it there are 3 different optimization flags you want to turn off for debugging :

  • LLVM Link Time Optimization (-flto)
  • LLVM Optimization Level (-O)
  • Swift Compiler Optimization Level

Sample Image

More information about LTO:
http://llvm.org/docs/LinkTimeOptimization.html

optimization - stepping may behave oddly; variables may not be available in Xcode 9.1

You are receiving this message because you set your target's optimization level to one of the Fast options.

Set the Optimization Level to None while debugging to make the message go away and your break points behave normally:

Sample Image

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

For anyone who also face this problem, try uncheck the "Strip Engine Code" at File > Build Settings > Player Settings (iOS).

http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html

How to change the optimization level?

The build settings are tied to configurations. In your build settings for optimization, the Debug configuration is set to nonoptimized, and the Release configuration is set to optimized.

So far, so good.

But which configuration are you actually using when you build? That is determined by the scheme. Use the Scheme Editor to look at the schemes for your different targets. (You will have to look at them one at a time.) In each, look in the Run action. It says which configuration to use. If the pop-up says Release, change it to Debug.

Xcode: Cannot set optimization level for debug

It looks like you've accidentally deleted your debug configuration. To prove this to yourself, look at your project's Info pane. You should see this — but I'm betting you won't:

Sample Image

A configuration is just a name, so you can easily recreate the debug configuration right here in the project settings; but that won't magically restore all the corresponding default build setting values. Your best bet is to consider this project hosed: make a new project, to get the template's values for the build settings, and migrate everything from this project into it.



Related Topics



Leave a reply



Submit