Add prebuilt apk to AOSP build

2,688 views
Skip to first unread message

Philippe Bellanger

unread,
Nov 11, 2015, 12:36:40 PM11/11/15
to Android Building

I tried to include a prebuilt google apk (with no .so file) to my marshmallow AOSP build as follows:

  1. 1. In my vendor/manufacturer/device/proprietary/system/app, I created a folder named 'Testapk'.

  2. 2. I saved two files in this 'Testapk' folder, the apk ('Testapk.apk') and an Android.mk file which contains the following instructions:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_MODULE := Testapk

LOCAL_SRC_FILES := $(LOCAL_MODULE).apk

LOCAL_MODULE_CLASS := APPS

LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)

LOCAL_CERTIFICATE := PRESIGNED

include $(BUILD_PREBUILT)

  1. I added the following instruction in my vendor/manufacturer/device/vendor_device.mk :

PRODUCT_PACKAGES += Testapk

When making the AOSP build, I get the following error:

make: *** No rule to make target `/Testapk', needed by `out/target/product/mako/obj/APPS/Books_intermediates/Testapk.apk'.  Stop.

#### make failed to build some targets (01:00 (mm:ss)) ####


What is causing the error and why? Thanks.


Ying Wang

unread,
Nov 11, 2015, 2:03:11 PM11/11/15
to Android Building
Looks like you have trailing space after the line "LOCAL_MODULE := Testapk" , so the space become part of $(LOCAL_MODULE).
Probably you also have trailing spaces on the line "LOCAL_PATH := $(call my-dir)".
$(LOCAL_SRC_FILES) then expands to " Testapk .apk".
Make sure no unneeded spaces in your Android.mk.


--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

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

Philippe Bellanger

unread,
Nov 13, 2015, 10:49:26 AM11/13/15
to Android Building
Thank you so much, Ying Wang! The trailing spaces on each line of my Android.mk file were indeed the problem. Thank you for taking the time to help me.
Reply all
Reply to author
Forward
0 new messages