"No rule to make target" when compiling NDK sources on Windows

2,093 views
Skip to first unread message

Andrew Marshall

unread,
Mar 17, 2014, 5:05:13 PM3/17/14
to adt...@googlegroups.com
I am attempting a basic Android app containing an NDK library built from source. I get the following error when building : 

---------------------------------------
> gradlew assembleArm
:mlabdemo:compileArmDebugNdk
make.exe: *** No rule to make target `C:\Users\Andrew\dev\MLabDemo\mlabdemo\build\ndk\arm\debug\obj/local/armeabi-v7a/objs-debug/process/C_\Users\Andrew\dev\MLabDemo\mlabdemo\src\main\jni', needed by `C:\Users\Andrew\dev\MLabDemo\mlabdemo\build\ndk\arm\debug\obj/local/armeabi-v7a/objs-debug/process/C_\Users\Andrew\dev\MLabDemo\mlabdemo\src\main\jni\process.o'.  Stop.
:mlabdemo:compileArmDebugNdk FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mlabdemo:compileArmDebugNdk'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
        C:\Users\Andrew\dev\android-ndk-r9d\ndk-build.cmd NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=C:\Users\Andrew\dev\MLabDemo\mlabdemo\build\ndk\arm\debug\Android.mk APP_PLATFORM=android-18 NDK_OUT=C:\Users\Andrew\dev\MLabDemo\mlabdemo\build\ndk\arm\debug\obj NDK_LIBS_OUT=C:\Users\Andrew\dev\MLabDemo\mlabdemo\build\ndk\arm\debug\lib NDK_DEBUG=1 APP_STL=stlport_static APP_ABI=armeabi-v7a
Error Code:
        2
---------------------------------

The path segments I've highlighted in red look 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:\Users\Andrew\dev\MLabDemo\mlabdemo\src\main\jni\process.cpp \

LOCAL_C_INCLUDES += C:\Users\Andrew\dev\MLabDemo\mlabdemo\src\main\jni
LOCAL_C_INCLUDES += C:\Users\Andrew\dev\MLabDemo\mlabdemo\src\arm\jni
LOCAL_C_INCLUDES += C:\Users\Andrew\dev\MLabDemo\mlabdemo\src\debug\jni
LOCAL_C_INCLUDES += C:\Users\Andrew\dev\MLabDemo\mlabdemo\src\armDebug\jni

include $(BUILD_SHARED_LIBRARY)
-------------------------------------

I am using 
 - gradle plugin 0.9
 - NDK r9d for Windows x64

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.


Cheers,
Andrew.

Xavier Ducrohet

unread,
Mar 17, 2014, 6:54:02 PM3/17/14
to adt...@googlegroups.com
This looks totally wrong. I'll look into it.


--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

Xavier Hallade

unread,
Mar 18, 2014, 6:03:12 AM3/18/14
to adt...@googlegroups.com
Hi,

I've filled a bug on this last week: https://code.google.com/p/android/issues/detail?id=66937
It's a really weird once, since I just needed to add a second source file to be compiled to "fix" this error, and same command worked.

Regards,
Xavier.
Reply all
Reply to author
Forward
0 new messages