If you have exception-handling code in your project and you try to build for Android YYC, then you may well see that your build fails with one of the following lines:
- error: cannot use 'try' with exceptions disabled
- error: cannot use 'throw' with exceptions disabled
This is something we have now fixed internally ahead of the 2.3.2 release, but as it's such an easy fix you can apply to your own install right now, we're sharing the info so you don't have to wait for the new release.
Note that we show runtime 2.3.1.409 below, but you can apply the same fix to runtime 2.3.1.406 also.
Open the relevant runtime file for your IDE install in a plaintext editor of your choice:
- Windows C:\ProgramData\GameMakerStudio2\Cache\runtimes\runtime-2.3.1.409\yyc\android\TemplateLib\jni\libyoyo-app${Num}\Android.mk
- macOS /Users/Shared/GameMakerStudio2/Cache/runtimes/runtime-2.3.1.409/yyc/android/TemplateLib/jni/libyoyo-app${Num}/Android.mk
Search for the line which starts with LOCAL_CFLAGS line as shown below:
LOCAL_CFLAGS := -c -DYYLLVM=1 -DANDROID_NDK=1 -Wno-tautological-pointer-compare -Wno-parentheses-equality -Wno-deprecated-writable-strings -funsigned-char -fexceptions
and add " -fexceptions" onto the end (note the space at the start), like we have it here:
LOCAL_CFLAGS := -c -DYYLLVM=1 -DANDROID_NDK=1 -Wno-tautological-pointer-compare -Wno-parentheses-equality -Wno-deprecated-writable-strings -funsigned-char -fexceptions
Save and close the Android.mk file - making sure that your text editor does not change the file extension in any way! - and then inside GameMaker clean your project cache and finally build again.
All should be fixed now.