I am trying to build a hello world executable for android. My test.c:
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Hello World\n");
return 0;
}
My Android.mk:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# give module name
LOCAL_MODULE := hello_world
# list your C files to compile
LOCAL_SRC_FILES := test.c
# this option will build executables instead of building library for android application.
include $(BUILD_EXECUTABLE)
My Application.mk:
APP_ABI := all
I ran ndk-build and I got 7 executables each in individual directory in libs - arm64-v8a armeabi armeabi-v7a mips mips64 x86 x86_64 when I ran file command, I got
hello_world: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), stripped
But when I pushed this to adb shell and execute it, I get an error:
not executable: magic 7F45.
What should I do to get this working?