如何在android.mk中实现androidx work runtime?

How to implement androidx work runtime in android.mk?

我正在尝试将一个库添加到我的 Android.mk 文件中,但我还没有成功。 build.gradle 文件中有库的实现如下;

implementation "androidx.work:work-runtime:2.4.0"

在 Android.mk 文件中我使用了类似的东西;

LOCAL_STATIC_ANDROID_LIBRARIES := \
    androidx.work_work-runtime

但是在构建项目时出现错误。

error: MyApp (APPS android-arm) missing androidx.work_work-runtime (JAVA_LIBRARIES android-arm) 
You can set ALLOW_MISSING_DEPENDENCIES=true in your environment if this is intentional, but that may defer real problems until later in the build.
build/make/core/main.mk:846: error: exiting from previous errors.

所以如果有人能在这里帮助我,我会很高兴。谢谢!!!

将以下定义添加到您的 makefile 中..

LOCAL_STATIC_ANDROID_LIBRARIES := \
  androidx.core_core

LOCAL_STATIC_JAVA_LIBRARIES := \
  androidx.lifecycle_lifecycle-runtime \
  androidx.lifecycle_lifecycle-service \
  androidx.room_room-runtime \
  androidx.sqlite_sqlite \
  androidx.sqlite_sqlite-framework \
  guava \
  workruntime

LOCAL_AAPT_FLAGS := \
  --extra-packages androidx.work

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := workruntime:libs/work-runtime-2.4.0.aar
include $(BUILD_MULTI_PREBUILT)