问题
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:
In my vendor/manufacturer/device/proprietary/system/app, I created a folder named 'Testapk'.
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)
- 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