Add prebuilt apk to AOSP build

杀马特。学长 韩版系。学妹 提交于 2019-12-21 04:41:08

问题


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)) ####

回答1:


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.




回答2:


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

PRODUCT_PACKAGES += \ Testapk


来源:https://stackoverflow.com/questions/33622299/add-prebuilt-apk-to-aosp-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!