Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add prebuilt apk to AOSP build

I tried to include a prebuilt google apk (with no .so file) to my marshmallow AOSP build based on the information found in this link as follows:

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

  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)) ####
like image 493
Phil Avatar asked Nov 10 '15 03:11

Phil


2 Answers

The problem with my Android.mk file was that it had trailing spaces on each line. Everything worked fine after I deleted these trailing spaces.

like image 147
Phil Avatar answered Sep 20 '22 17:09

Phil


after the \ the "testapk" should be on a new line.

PRODUCT_PACKAGES += \ Testapk
like image 20
HRH Sven Olaf of CyberBunker Avatar answered Sep 22 '22 17:09

HRH Sven Olaf of CyberBunker