Skip to content

Commit

Permalink
ReactAndroid: add -fexceptions -frtti to jni CFLAGS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EmielM committed Apr 29, 2019
1 parent ffa3b0d commit fede301
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ReactAndroid/src/main/jni/Application.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fede301

Please sign in to comment.