只有一个apk文件,如何添加到Andorid源码中,开机之后这个apk已经安装好。
1.device/amlogic/f20ref/f20ref.mk中copy file到system/app目录下。
PRODUCT_COPY_FILES += \ device/amlogic/f20ref/hello.apk:system/app/hello.apk
2. make 源代码。
*** Prebuilt apk found in PRODUCT_COPY_FILES: device/amlogic/f16ref/hello.apk:/system/app/hello.apk, use BUILD_PREBUILT instead!. Stop.
原因是build/core/Makefile中对copy file作了检测,如果是apk文件,会出错。
解决办法:注释掉build/core/Makefile文件中检测apk代码
#define check-product-copy-files #$(if $(filter %.apk, $(1)),$(error \ Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT inst ead!)) #endef
3.在make otapackage时,报错:
File "/build/tools/releasetools/edify_generator.py", line 213, in SetPermissions self.script.append('set_perm(%d, %d, 0%o, "%s");' % (uid, gid, mode, fn)) TypeError: %d format: a number is required, not NoneType
可能是你的apk名字中包含非法字符,如中文,"-",等.