I'm new to Android studio and android NDK. I'm trying to compile a simple hello.c program with android NDK for a class assignment. I've followed the following project instructions but get an error:
Create a c program
create Android.mk with following contents:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := hello.out
LOCAL_SRC_FILES :=hello.c
include $(BUILD_EXECUTABLE)Create Application.mk with following content:
APP_ABI := armeabi
APP_PLATFORM := android-10
APP_STL := stlport_static
APP_BUILD_SCRITP := Android.mkPut hello.c, Android.mk, Application.mk into same folder x.
go to folder x
run command:
export NDK_PROJECT_PATH=.
Run command
[NDK_dir]/ndk-build NDK_APPLICATION_MK=./Application.mk
the executable will be generated at ./libs/armeabi/hello.out
But I get this error when following those instructions:
/home/justin/Desktop/android-ndk-r16/build/core/add-application.mk:49: Application.mk: No such file or directory
Android NDK: APP_PLATFORM not set. Defaulting to minimum supported version android-14.
Android NDK: There is no Android.mk under ./jni
Android NDK: If this is intentional please define APP_BUILD_SCRIPT to point
Android NDK: to a valid NDK build script.
/home/justin/Desktop/android-ndk-r16/build/core/add-application.mk:116: *** Android NDK: Aborting... . Stop.
I installed android NDK components through Andoird studio SDK and my [NDK_DiR] is /home/justin/Android/Sdk/ndk-bundle