I am trying to compile my Android React Native project using the local version of foractive-native. I followed the build from the source guide and followed all the steps (without using Android Studio).
When I try to start react-native run-android(from the project root as usual), I get:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ReactAndroid:buildReactNdkLib'.
> Process 'command '/usr/local/opt/android-ndk/ndk-build'' finished with non-zero exit value 2
When I run ndk-build(from the root of the project), I get:
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/usr/local/Cellar/android-ndk/r12b/build/core/build-local.mk:151: *** Android NDK: Aborting . Stop.
Another SO thread pointed me in the direction of starting ndk-buildfrom ./android/app/srcand created a directory there jni(I didn’t have one), but I'm not sure how to create it correctly or correctly jni/Android.mk, or if it even helps me. I tried to create jni/Application.mkwith the content APP_BUILD_SCRIPT := Android.mkand jni/Android.mkwith the setup described in this SO question. Execution ndk-buildof android/app/srcfails with the following error:
Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: Android.mk
/usr/local/Cellar/android-ndk/r12b/build/core/add-application.mk:198: *** Android NDK: Aborting... . Stop.
I have the Android SDK and NDK installed with Homebrew, and I have the following export:
ANDROID_HOME=/usr/local/opt/android-sdk
ANDROID_SDK=/usr/local/opt/android-sdk
ANDROID_NDK=/usr/local/opt/android-ndk
ANDROID_NDK_HOME=/usr/local/opt/android-ndk
I feel like I'm near, but have no idea how to proceed.
source
share