我正在尝试学习如何在android源代码中编译应用程序。该应用程序只是一个简单的hello world应用程序。我按照Making an app in the Android Source compile into system/app instead of data/app?和其他几个来源的说明进行操作。但是当我创建应用程序时,apk文件被写入带有后缀中间体而不是系统/应用程序的obj / APPS,并且在启动时无法在模拟器中显示。请在下面找到Android.mk文件。
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_MODULE_PATH := system/app
LOCAL_UNINSTALLABLE_MODULE := true
LOCAL_SDK_VERSION := current
LOCAL_PACKAGE_NAME := MyApplication
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-gridlayout
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v13
LOCAL_STATIC_JAVA_LIBRARIES += android-support-design
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/appcompat/res
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/gridlayout/res
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/design/res
LOCAL_CERTIFICATE := platform
LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat:android.support.v7.gridlayout
include $(BUILD_PACKAGE)
##################################################
include $(CLEAR_VARS)
include $(BUILD_MULTI_PREBUILT)
# Use the following include to make our test apk.
include $(call all-makefiles-under,$(LOCAL_PATH))
我通过转到软件包/应用程序中的应用程序目录并执行' mm来制作应用程序。我在这里找不到任何东西?
答案 0 :(得分:0)
找出BoardConfig.mk并添加:
PRODUCT_PACKAGES += MyApplication
AOSP构建系统将构建每个Android.mk,但只有BoardConfig中定义的软件包才会被放入最终的产品路径中。
答案 1 :(得分:0)
您必须从设备/“您的首选供应商”/“device_name”/ aosp_“设备名称”.mk文件
将app模块添加到PRODUCT_PACKAGE中它应该类似于以下
$(call inherit-product, device/lge/hammerhead/full_hammerhead.mk)
PRODUCT_NAME := aosp_hammerhead
PRODUCT_PACKAGES += \
Launcher3 \
MyApplication \
答案 2 :(得分:0)
它几乎没有变化。 Aosp检查/ device /“供应商” /“ your_device” /“您的平台” /base.mk文件进行编译,并检查/device/"vendor"/"your_device"/common/base.mk将apk安装到/ out / target / product /“您的设备/系统/应用/ 您应该将应用名称添加到两个文件中。 就我而言aosp / device / qcom / qssi / base.mk进行编译, aosp / device / qcom / common / base.mk将输出(apk)安装到/ out / target / product / msm8953 / system / app /