From 15f60284deca177b5fcce3c2fcbceaf7c271ac21 Mon Sep 17 00:00:00 2001 From: Ashwin Phatak Date: Wed, 23 Aug 2017 13:06:22 +0530 Subject: [PATCH] Fix 'jni_md.h: No such file or directory' error when building on Ubuntu 16.04 LTS When building Android on Ubuntu 16.04 LTS, this fixes an error for a missing header file: In file included from ./src/android/io_realm_react_RealmReactModule.cpp:19:0: /usr/lib/jvm/java-8-oracle/include/jni.h:45:20: fatal error: jni_md.h: No such file or directory ^ compilation terminated. make: *** [/home/ashwinp/projects/realm-js/react-native/android/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs-debug/realmreact/src/android/io_realm_react_RealmReactModule.o] Error 1 make: *** Waiting for unfinished jobs.... make: Leaving directory `/home/ashwinp/projects/realm-js/react-native/android/src/main/jni' :buildReactNdkLib FAILED FAILURE: Build failed with an exception. --- react-native/android/src/main/jni/Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/react-native/android/src/main/jni/Android.mk b/react-native/android/src/main/jni/Android.mk index 1fe4eafa..9fe404aa 100644 --- a/react-native/android/src/main/jni/Android.mk +++ b/react-native/android/src/main/jni/Android.mk @@ -70,6 +70,7 @@ LOCAL_C_INCLUDES += src/object-store/external/pegtl LOCAL_C_INCLUDES += vendor LOCAL_C_INCLUDES += $(JAVA_HOME)/include LOCAL_C_INCLUDES += $(JAVA_HOME)/include/darwin +LOCAL_C_INCLUDES += $(JAVA_HOME)/include/linux LOCAL_C_INCLUDES += core/include ifeq ($(strip $(BUILD_TYPE_SYNC)),1) LOCAL_C_INCLUDES += src/object-store/src/sync