I am attempting a basic Android app containing an NDK library built from source. I get the following error when building :
gradlew assembleArm
:myapp:compileArmDebugNdk
make.exe: *** No rule to make target
`C:\Projects\MyApp\myapp\build\ndk\arm\debug\obj/local/armeabi-v7a/objs-debug/process/C_\Projects\MyApp\myapp\src\main\jni', needed by `C:\Projects\MyApp\myapp\build\ndk\arm\debug\obj/local/armeabi-v7a/objs-debug/process/C_\Projects\MyApp\myapp\src\main\jni\process.o'. Stop.
:myapp:compileArmDebugNdk FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':myapp:compileArmDebugNdk'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\android-ndk-r9d\ndk-build.cmd NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Projects\MyApp\myapp\build\ndk\arm\debug\Android.mk APP_PLATFORM=android-18 NDK_OUT=C:\Projects\MyApp\myapp\build\ndk\arm\debug\obj NDK_LIBS_OUT=C:\Projects\MyApp\myapp\build\ndk\arm\debug\lib NDK_DEBUG=1 APP_STL=stlport_static APP_ABI=armeabi-v7a
The target path looks odd to me. The makefile generated by gradle looks like this:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := process
LOCAL_CFLAGS := -DANDROID_NDK
LOCAL_SRC_FILES := \
C:\Projects\MyApp\myapp\src\main\jni\process.cpp \
LOCAL_C_INCLUDES += C:\Projects\MyApp\myapp\src\main\jni
LOCAL_C_INCLUDES += C:\Projects\MyApp\myapp\src\arm\jni
LOCAL_C_INCLUDES += C:\Projects\MyApp\myapp\src\debug\jni
LOCAL_C_INCLUDES += C:\Projects\MyApp\myapp\src\armDebug\jni
include $(BUILD_SHARED_LIBRARY)
I am using
I'd appreciate any help. I've got some experience with gradle and GNU build tools but I'm new to Android and the NDK.
Like Selvin said, it should be fine as soon as you add another source file. Even an empty one will do the trick.
I've filled a bug report with more information: https://code.google.com/p/android/issues/detail?id=66937
Just go to Terminal and write
1: cd your_path_to\src\main\jni
2: ndk-build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With