From b124e5be3c58521c136820cff3c322957777d81b Mon Sep 17 00:00:00 2001 From: Emiel Mols Date: Mon, 29 Apr 2019 15:01:24 +0200 Subject: [PATCH] ReactAndroid: add -fexceptions -frtti to jni CFLAGS This fixes a regression on Android introduced by f3e5cce where JS errors thrown during bundle load were lost (shown only as UnknownCppException). It is especially tough to debug (custom) bundling errors without seeing the javascript error. Root cause hypothesis: since switching to clang, JSErrors thrown in ReactCommon's JSCRuntime::checkException were never matched as std::exception in Android's convertCppExceptionToJavaException due to these missing flags. --- ReactAndroid/src/main/jni/Application.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/jni/Application.mk b/ReactAndroid/src/main/jni/Application.mk index c73c0397f5d24d..017ddd7bc469b9 100644 --- a/ReactAndroid/src/main/jni/Application.mk +++ b/ReactAndroid/src/main/jni/Application.mk @@ -27,7 +27,7 @@ NDK_MODULE_PATH := $(APP_MK_DIR)$(HOST_DIRSEP)$(THIRD_PARTY_NDK_DIR)$(HOST_DIRSE APP_STL := c++_shared # Make sure every shared lib includes a .note.gnu.build-id header -APP_CFLAGS := -Wall -Werror +APP_CFLAGS := -Wall -Werror -fexceptions -frtti APP_CPPFLAGS := -std=c++1y APP_LDFLAGS := -Wl,--build-id