x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Exceptions disabled when building for iOS

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.

Product Version: UE 4.9
Tags:
more ▼

asked Aug 23 '16 at 12:12 PM in C++ Programming

avatar image

DJ_Lectr0
110 15 18 27

avatar image Matthew J Aug 23 '16 at 01:54 PM

Hello DJ_Lectr0,

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.

avatar image Matthew J Aug 23 '16 at 01:58 PM

Actually, after looking up that error message I came across this: 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.

avatar image DJ_Lectr0 Aug 23 '16 at 02:01 PM

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?

avatar image Matthew J Aug 23 '16 at 02:11 PM

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 https://answers.unrealengine.com/questions/51798/how-can-i-enable-unwind-semantics-for-c-style-exce.html

avatar image DJ_Lectr0 Aug 23 '16 at 02:15 PM

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

avatar image Matthew J Aug 23 '16 at 02:23 PM

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.

avatar image DJ_Lectr0 Aug 23 '16 at 02:33 PM

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.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Aug 23 '16 at 05:14 PM

avatar image DJ_Lectr0 Aug 23 '16 at 05:27 PM

That sounds great. Thank you!

avatar image Jakub Karel Oct 19 '16 at 09:49 AM

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.

avatar image Matthew J Oct 19 '16 at 03:00 PM

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.

avatar image gurankas Nov 20 '18 at 05:21 AM

@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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question