Как импортировать android .arch.lifecycle в AOSP - PullRequest
0 голосов
/ 27 мая 2020

Я пытаюсь создать свое приложение в AOSP с Android .mk на Android 8.1. Я использую архитектуру MVVM, для которой требуется пакет «android .arch.lifecycle». При компиляции кодов я выдал ошибку:

Импорт android .arch.lifecycle.LiveData не может быть разрешен

Вот мой Android .mk :

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-java-files-under, java)

LOCAL_PRIVATE_PLATFORM_APIS := true

#LOCAL_STATIC_ANDROID_LIBRARIES := \
#   android-arch-core-runtime \
#   android-arch-lifecycle-extensions

#LOCAL_SHARED_JAVA_LIBRARIES := \
#    android-arch-lifecycle-common
#
#LOCAL_SHARED_ANDROID_LIBRARIES := \
#    android-arch-lifecycle-runtime


LOCAL_STATIC_JAVA_LIBRARIES := \
    android-support-design \
    android-support-v4 \
    android-support-v7-appcompat \
    android-support-v7-recyclerview \
    android-support-v7-cardview \
    android-support-v7-preference \
    android-support-transition \
    android-support-v14-preference \
    constraint-layout-solver \
    volley \
    XXFwUpdateCore

LOCAL_JAVA_LIBRARIES := \
    core-oj \
    XXDeviceAdminSDK

LOCAL_RESOURCE_DIR := \
    $(TOP)/frameworks/support/design/res \
    $(TOP)/frameworks/support/v7/appcompat/res \
    $(TOP)/frameworks/support/v7/cardview/res \
    $(TOP)/frameworks/support/v7/recyclerview/res \
    $(TOP)/frameworks/support/v7/preference/res \
    $(TOP)/frameworks/support/v14/preference/res \
    $(LOCAL_PATH)/res

LOCAL_AAPT_FLAGS := \
    --auto-add-overlay \
    --extra-packages android.support.design \
    --extra-packages android.support.v7.appcompat \
    --extra-packages android.support.v7.recyclerview \
    --extra-packages android.support.v7.cardview \
    --extra-packages android.support.v14.recyclerview \
    --extra-packages android.support.v7.preference \
    --extra-packages android.support.v14.preference \
    --extra-packages android.support.constraint \
    --extra-packages com.android.settingslib

LOCAL_AAPT_FLAGS += --rename-manifest-package XX.com.firmwareupdate

LOCAL_STATIC_JAVA_AAR_LIBRARIES := \
    constraint-layout

LOCAL_PACKAGE_NAME := XXFirmwareAgent

LOCAL_PROGUARD_FLAGS := -include $(LOCAL_PATH)/proguard.flag

#LOCAL_DEX_PREOPT := false
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true

LOCAL_REQUIRED_MODULES := privapp-permissions-XX.com.firmwareupdate.xml

LOCAL_JNI_SHARED_LIBRARIES := libvendorlibproxy

LOCAL_MODULE_INCLUDE_LIBRARY := true

LOCAL_REQUIRED_MODULES += libvendorlibproxy
LOCAL_REQUIRED_MODULES += XXFwUpdateCore
LOCAL_PROGUARD_ENABLED := disabled

include $(BUILD_PACKAGE)

include $(CLEAR_VARS)
LOCAL_MODULE := privapp-permissions-XX.com.firmwareupdate.xml
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions
LOCAL_SRC_FILES := $(LOCAL_MODULE)
include $(BUILD_PREBUILT)

include $(LOCAL_PATH)/jni/Android.mk
include $(LOCAL_PATH)/../../../../fwupatecore/src/main/Android.mk
include $(call all-makefiles-under,$(LOCAL_PATH))

#include $(CLEAR_VARS)

#LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := constraint-layout-solver:../../libs/constraint-layout-solver-1.0.2.jar

#include $(BUILD_MULTI_PREBUILT)

#include $(CLEAR_VARS)

#LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := constraint-layout:../../libs/constraint-layout-1.0.2.aar

#include $(BUILD_MULTI_PREBUILT)

Спасибо. Спасибо. Спасибо. Спасибо.Спасибо.

...