2

In Android in the Application i want to import one android.mk file into another Android.mk file in the Application

for this i have used in one Andorid.mk file which is to be imported into another module of same project

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := EDSDKModule
LOCAL_SRC_FILES :=libEDSDK.a
LOCAL_ARM_MODE := arm
TARGET_PLATFORM:=android-8
TARGET_ARCH_ABI:=armeabi
TARGET_ABI:=$(TARGET_PLATFORM)-$(TARGET_ARCH_ABI)
include $(PREBUILT_STATIC_LIBRARY)

and main Andorid.mk file is written is

include C:\my_module\Android.mk
 LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE    := EDSK
LOCAL_MODULE_FILENAME := foo 
LOCAL_SRC_FILES := sample.c
LOCAL_STATIC_LIBRARIES := EDSDKModule
include $(BUILD_SHARED_LIBRARY)
LOCAL_ARM_MODE := arm
TARGET_PLATFORM:=android-8
TARGET_ARCH_ABI:=armeabi
TARGET_ABI:=$(TARGET_PLATFORM)-$(TARGET_ARCH_ABI)
$(call import-module,EDSDKModule)

but i have got this error on building project using Android-NDk i.e

please suggest some solutions on how to import one module into another module of android.mk file in a project

user1465789
  • 21
  • 2
  • 7
  • have you tried http://stackoverflow.com/questions/6355055/android-ndk-import-module-code-reuse – K_Anas Jun 25 '12 at 07:15

1 Answers1

0

I am guessing the problem is here :

    $NDK_MODULE_PATH\C:\Final FOlder\final c\Mysetup\newworks\SimpleApp\jni\path1\Android.mk:
    /*here i have given directory path of android.mk file */

Possible mistakes :

  • Try to get rid of the empty spaces in the path :

    C:\Final FOlder\final c\ 
    

to something like this :

    C:\FInal_Folder\final_c\myotherdir\xyz.mk
  • If you are using a absolute path like :

    C:\mypath\myotherdir\xyz.mk
    

then you NEED NOT prefix it with $NDK_MODULE_PATH. Just use the above absolute path itself, which is C:\mypath\myotherdir\xyz.mk

  • You need an include keyword infront of your above include statement :

    # comment : including my mk file here
    include C:\mypath\myotherdir\xyz.mk
    
  • Get rid of the : in the end of your include statement

So you have to do something like :

    include C:\mypath\myotherdir\xyz.mk

OR

If you have the mk file in NDK LOCAL FOLDER then

    include $NDK_MODULE_PATH\mylocaldir\xyz.mk

Hope this helps. CHeers!

Hari Krishna Ganji
  • 1,647
  • 2
  • 20
  • 33
  • i have used following commends in Android.mk file **** include C:\my_module\Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := EDSK LOCAL_MODULE_FILENAME := foo LOCAL_SRC_FILES := sample.c LOCAL_STATIC_LIBRARIES := libEDSDK.a include $(BUILD_SHARED_LIBRARY) $(call import-module,EDSDKModule) ************but i get error i.e *Android NDK: C:\my_module\Android.mk: Cannot find module with tag 'EDSDKModule' in import path Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ? jni/Android.mk:14: Android NDK: Aborting. . Stop. Android NDK: – user1465789 Jun 26 '12 at 09:06
  • Can you tell me, from where you copied the original **"C:\my_module\Android.mk"** file from? Because your imported Android.mk seems to be looking for the following modules : **`libEDSDK.a, EDSDK, EDSDKErrors, EDSDKTypes`** from **`$(LOCAL_PATH)`**. I suggest you **COPY EVERYTHING** from the **original directory containing** the imported **`Android.mk`** and the **`libEDSDK.a`**, into the local main Android.mk directory. That should solve the problem. Cheers! – Hari Krishna Ganji Jun 26 '12 at 10:28
  • in my_module folder i have placed Android.mk,EDSDk.h,EDSDkERRors.h EDSDKTypes.h and libEDSDl.a file from the project and in jni folder of the project i have also placed EDSDk.h,EDSDkERRors.h EDSDKTypes.h and libEDSDl.a file but problem is still the same can explain more about NDK LOCAL FOLDER sorry but i don't understand it ow i placed imported Android.mk in NDK LOCAL FOLDER i can't understand this "NDK LOCAL FOLDER" – user1465789 Jun 26 '12 at 11:21
  • Can you update the new ANdroid.mk in your question please? Add a section below existing content, so that I can take a look at the whole Android.mk file. – Hari Krishna Ganji Jun 26 '12 at 11:30