0

I want to add my pre-built APK to my AOSP build. I've created the following folders vendor/aaa/crespo and pasted my APK inside the folder. I've also created a make file to install my APK.

The make file is as follows:

$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
include $(CLEAR_VARS)
LOCAL_MODULE_PATH := vendor/aaa/crespo/
LOCAL_MODULE_PATH := $(strip $(LOCAL_MODULE_PATH))
ifeq ($(LOCAL_MODULE_PATH),)
  LOCAL_MODULE_PATH := $($(my_prefix)OUT$(partition_tag)_$(LOCAL_MODULE_CLASS))
  ifeq ($(strip $(LOCAL_MODULE_PATH)),)
    $(error $(LOCAL_PATH): unhandled LOCAL_MODULE_CLASS "$(LOCAL_MODULE_CLASS)")
  endif
endif
  # Module name should match apk name to be installed.
  LOCAL_MODULE := test
  LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
  LOCAL_MODULE_CLASS := APPS
  LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
  LOCAL_MODULE_TAGS := optional
  LOCAL_CERTIFICATE := PRESIGNED
  include $(BUILD_PREBUILT)

Can anyone tell me what is wrong with the make file? In this make file, I want to tell the compiler to add my APK into the build. It builds fine but my app is not present in the installed-files.txt file.

1
  • You don't need to process LOCAL_MODULE_PATH like that, build system will already do that for you.
    – auselen
    Nov 27, 2012 at 7:53

2 Answers 2

1

Reading build script at github

LOCAL_MODULE_PATH := $(strip $(LOCAL_MODULE_PATH))
ifeq ($(LOCAL_MODULE_PATH),)
  LOCAL_MODULE_PATH := $($(my_prefix)OUT$(partition_tag)_$(LOCAL_MODULE_CLASS))
  ifeq ($(strip $(LOCAL_MODULE_PATH)),)
    $(error $(LOCAL_PATH): unhandled LOCAL_MODULE_CLASS "$(LOCAL_MODULE_CLASS)")
  endif
endif

It is your path that's wrong. If Android.mk is at the same directory, I don't think you need to put path in front of it. By the way you are also not setting LOCAL_CERTIFICATE - I don't know if necessary but majority seems to set it.

7
  • then in which directory should my apk be kept??
    – Neji
    Nov 26, 2012 at 13:19
  • you should describe your directory structure & file names in a case sensitive way.
    – auselen
    Nov 26, 2012 at 14:07
  • yep! took care about case sensitivity and also i've kept the apk in same directory vendor/aaa/crespo/test.apk . Is it ok then?
    – Neji
    Nov 26, 2012 at 14:31
  • PLz check now! i've updated the make file still ma app is not present in the installed-files.txt after build
    – Neji
    Nov 27, 2012 at 7:46
  • You need to have it in PRODUCT_PACKAGES. Btw next time you start a build just type 'mm' in that directory you may get a shorter build.
    – auselen
    Nov 27, 2012 at 7:51
0

In my case it helped to include Android.mk with definitions via macro all-makefiles-under:

include $(call all-makefiles-under, $(LOCAL_PATH))

Problem occurred when i include Android.mk directly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.