# Exceptions disabled when building for iOS

**URL:** <https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996>\
**Category:** Platform & Builds\
**Tags:** exception, unreal-engine, iOS, packaging-projects, CPP, question\
**Created:** [August 23, 2016, 12:12pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996 "2016-08-23T12:12:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_515625df](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_515625df](https://forums.unrealengine.com/u/anonymous_user_515625df)\
**Post date:** [August 23, 2016, 12:12pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/1 "2016-08-23T12:12:34Z")

</div>

I am trying to package a project for iOS which uses exception handling. Even when exceptions are force turned on with `UEBuildConfiguration.bForceEnableExceptions = true;`, packaging fails with the following error:

Cannot use try with exceptions disabled.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [August 23, 2016, 1:54pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/2 "2016-08-23T13:54:52Z")

</div>

Hello ,

What configuration are you trying to build for? If it’s for shipping, that could be related as it may not be allowed in the shipping configuration.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [August 23, 2016, 1:58pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/3 "2016-08-23T13:58:46Z")

</div>

Actually, after looking up that error message I came across this: [Cannot use 'try' with exceptions disabled - Programming & Scripting - Epic Developer Community Forums](https://answers.unrealengine.com/questions/264921/cannot-use-try-with-exceptions-disabled.html)

I wasn’t aware as I never tried using it, but it seems that Unreal doesn’t support exception handling.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_515625df](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_515625df](https://forums.unrealengine.com/u/anonymous_user_515625df)\
**Post date:** [August 23, 2016, 2:01pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/4 "2016-08-23T14:01:45Z")

</div>

Well Unreal does support it. In the OSX build configuration everything works as expected. When I build from Source I can also change UBT so that iOS gets exception support. But I think if you force enable the exceptions it should work without building from source, shouldn’t it?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [August 23, 2016, 2:11pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/5 "2016-08-23T14:11:56Z")

</div>

Is it possible that it’s being added in the wrong area? It seems like people were having some confusion here at first that was causing the same error you’re seeing [How can I enable unwind semantics for C++-style exceptions? - Programming & Scripting - Epic Developer Community Forums](https://answers.unrealengine.com/questions/51798/how-can-i-enable-unwind-semantics-for-c-style-exce.html)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_515625df](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_515625df](https://forums.unrealengine.com/u/anonymous_user_515625df)\
**Post date:** [August 23, 2016, 2:15pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/6 "2016-08-23T14:15:19Z")

</div>

No, as the source code does not consider the option. So the option is completely useless when building for iOS

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [August 23, 2016, 2:23pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/7 "2016-08-23T14:23:56Z")

</div>

Just to clarify, this working perfectly fine when building from source but doesn’t work properly when packaging with a Binary build, correct? I’ll ask RCL about the subject and see if he can give any ideas.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_515625df](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_515625df](https://forums.unrealengine.com/u/anonymous_user_515625df)\
**Post date:** [August 23, 2016, 2:33pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/8 "2016-08-23T14:33:21Z")

</div>

No. You have to change the source of the Engine to get it to compile correctly. It’s not an error, but rather - I think - unintended behavior. When you force exceptions on with bForceEnableExceptions, it should build on all Platforms with exceptions enabled. However, this is not the case and you have to change the source of Unreal Build Tool to get it to do that.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [August 23, 2016, 5:14pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/9 "2016-08-23T17:14:34Z")

</div>

I spoke to RCL and someone else who’s our owner of iOS development and it seems that the iOS toolchain itself is completely ignoring bForceEnableExceptions. They’re also assuming it’s legacy from UE3. There’s currently a task in to add support for exception handling in iOS but hasn’t been completed yet. Unfortunately it seems that you’ll need to use the workaround of doing it through source for the time being. I’ll watch the task and update you here if there are any changes or updates to it.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_515625df](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_515625df](https://forums.unrealengine.com/u/anonymous_user_515625df)\
**Post date:** [August 23, 2016, 5:27pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/10 "2016-08-23T17:27:37Z")

</div>

That sounds great. Thank you!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b89e5eb8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b89e5eb8](https://forums.unrealengine.com/u/anonymous_user_b89e5eb8)\
**Post date:** [October 19, 2016, 9:49am UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/11 "2016-10-19T09:49:20Z")

</div>

Hello Matthew, please, is there any update on the iOS toolchain exception handling issue? Right now I am standing before a decision how to deal with exceptions coming from a third party library and a vision of solution from the Unreal side wold save me a lot a work.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_41845f4a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_41845f4a](https://forums.unrealengine.com/u/anonymous_user_41845f4a)\
**Post date:** [October 19, 2016, 3:00pm UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/12 "2016-10-19T15:00:15Z")

</div>

It’s currently not a high priority task and is backlogged with no estimate of when it’ll be completed. I’ve updated the community interest section of it since you’ve expressed interest but this isn’t much more I can do to speed it along.

---

<div class="post-metadata">

**Author:** ![gurankas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gurankas](https://forums.unrealengine.com/u/gurankas)\
**Post date:** [November 20, 2018, 5:21am UTC](https://forums.unrealengine.com/t/exceptions-disabled-when-building-for-ios/367996/13 "2018-11-20T05:21:02Z")

</div>

@Matthew Is this issue still not fixed? I have a few custom C++ classes which use exception handling. When I try to package the project for Mac, it gives the same error stated here. Please provide the latest progress on this issue
