I am trying to integrate unity to iOS application. I have followed this tutorial http://www.agnosticdev.com/blog-entry/swift/integrating-unity-and-vuforia-ios-swift-project
Now after integrating when i start my app it crashes and show this error on console : was compiled with optimization - stepping may behave oddly; variables may not be available.
Crash :
I have tried googling this and found these links :
and nothing changed.
I have changed optimization level of both project and pod.
I have also added this line to pod file : project 'MyProject', 'Debug - local'=>:debug, 'Debug - staging'=>:debug, 'Debug - PRODUCTION'=>:debug
( before target 'projectname' do)
Also I have unchecked Strip Engine Code in unity.
What can i do to overcome this error ? Any help would be appreciated, thanks.
The code you're debugging is IL2CPP code, which is likely in a library prebuilt with optimizations (probably in libiPhone-lib.a). Your build settings only effect the code being compiled now in your xcode project, so they wouldn't effect a prebuilt lib. To get rid of the warning, you will need to rebuild that library, and you will need Unity source code to do that.
More importantly, it's not the cause of the crash. It's just telling you that it's going to be harder to find the source of the crash.
It looks like it's calling a function called LoadMetadataFile and crashing when accessing the return. You can probably set a breakpoint on that function call and see what's going in and out of it to find the next debugging step (the bl instructions 5 lines above the highlighted crashing line).
Here are some documents that might help you: Apples calling convention docs: https://developer.apple.com/library/content/documentation/Xcode/Conceptual/iPhoneOSABIReference/Articles/ARM64FunctionCallingConventions.html
Arm instruction reference (opened to the crashing instruction): http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0802a/LDRSW_imm.html
I had the same issue and I solve it adding to Apple LLVM - Custom Compiler FLags
:
Other C Flags: -DRUNTIME_IL2CPP=1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With