Cannot find -landroid

176 views
Skip to first unread message

Joren

unread,
Mar 28, 2015, 9:29:02 AM3/28/15
to antido...@googlegroups.com
Hi there. I'm trying to compile the c-code, following this answer found on this group.

However, I don't quite understand what the Android.mk file in the jni folder should contain. The poster says:

In jni folder, change the content of Android.mk to the following:
BASE_PATH:= $(call my-dir)
include $(BASE_PATH)/antidote/Android.mk

But I don't have an antidote folder, so I just kept what is in it:

BASE_PATH:= $(call my-dir)
include $(BASE_PATH)/src/communication/plugin/Android.mk
include $(BASE_PATH)/src/communication/plugin/trans/Android.mk
include $(BASE_PATH)/src/communication/plugin/android/Android.mk
include $(BASE_PATH)/src/communication/parser/Android.mk
include $(BASE_PATH)/src/communication/Android.mk
include $(BASE_PATH)/src/specializations/Android.mk
include $(BASE_PATH)/src/util/Android.mk
include $(BASE_PATH)/src/dim/Android.mk
include $(BASE_PATH)/src/api/Android.mk
include $(BASE_PATH)/src/trans/Android.mk
include $(BASE_PATH)/src/trans/plugin/Android.mk
include $(BASE_PATH)/src/Android.mk
include $(BASE_PATH)/apps/Android.mk

When running
../android-ndk-r10d/ndk-build NDK_PROJECT_PATH=.
however, I get an error "cannot find -landroid". I've tested to see which Android.mk file causes this, and it is only when te last one is included ($(BASE_PATH)/apps/Android.mk).

The contents of this Android.mk are not altered from the github repository:

LOCAL_PATH:= $(call my-dir)


include $
(CLEAR_VARS)


LOCAL_MODULE
:= healthd
LOCAL_MODULE_TAGS
:= debug eng


LOCAL_CFLAGS
:= -Wall


LOCAL_SRC_FILES
:= healthd_android.c healthd_common.c
LOCAL_CFLAGS
:= -Wall
LOCAL_C_INCLUDES
:= $(LOCAL_PATH) $(LOCAL_PATH)/.. $(LOCAL_PATH)/../src


LOCAL_WHOLE_STATIC_LIBRARIES
:= libantidotemanager


LOCAL_LDLIBS
:= -llog -landroid


include $
(BUILD_SHARED_LIBRARY)

What am I doing wrong?

Joren

unread,
Mar 28, 2015, 1:54:07 PM3/28/15
to antido...@googlegroups.com
EDIT
I wanted to edit my post but I can't find where to do so, so here an edit.

Apparantly more than only the -landroid is going wrong, so it could be a general issue of not linking something simple.

The first error is:
cannot open crt_begin_so.o
cannot open crt_end_so
.o
cannot find
-llog
cannot find
-landroid
etc

For a list of all the errors I made screenshots of my terminal: imgur album.

Christian Del'Aune

unread,
Apr 23, 2015, 1:04:00 PM4/23/15
to antido...@googlegroups.com
Hi,

I am running into the same issue, getting "error: cannot find -landroid" when I try to run ndk-build.cmd on the antidote source.  

I am running on Windows 8.1 x64 with the latest version of Android Studio.  I was able to successfully import the HealthService project and manually add the aidl files.  Then, I manually placed a clone of the entire antidote source (aside from 'Android_Samples' dir) into 'app/src/main/jni/antidote' and run ndk-build.cmd from the command line.  You can see the entire output in the attached file.

Am I missing a dependency?

Any help would be much appreciate.  Thanks!
Christian
ndk-build-dump.txt
Reply all
Reply to author
Forward
0 new messages