将 androidx.viewpager2 添加到 android.mk 文件
Add androidx.viewpager2 to android.mk file
正在尝试 将 androidx.viewpager2 添加到 android.mk,如下所示:
LOCAL_STATIC_ANDROID_LIBRARIES += \
androidx.viewpager2_viewpager2
无法使用 MMA 命令构建代码并给出以下错误。
ninja: error:
'out/target/common/obj/JAVA_LIBRARIES/androidx.viewpager2_viewpager2_intermediates/package-res.apk',
needed by
'out/target/product/apps/obj/APPS/app_intermediates/package-res.apk',
missing and no known rule to make it
05:31:24 ninja failed with: exit status 1
failed to build some targets (05:38 (mm:ss))
如何将 androidx.viewpager2 添加到 Android.mk Makefile。
您必须将 viewpager2-1.0.0.aar 添加到 LOCAL_STATIC_JAVA_LIBRARIES
(或 LOCAL_STATIC_JAVA_AAR_LIBRARIES
)中。
使用 Android.mk 文件中的 .AAR 库文件将以下块添加到 support/sync
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
.
.
LOCAL_PACKAGE_NAME := App_Name
.
LOCAL_PRIVATE_PLATFORM_APIS := true
.
LOCAL_STATIC_JAVA_LIBRARIES := AAR_file-alias
.
include $(BUILD_PACKAGE)
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := AAR_file-alias:lib_path/AAR_file.aar
include $(BUILD_MULTI_PREBUILT)
正在尝试 将 androidx.viewpager2 添加到 android.mk,如下所示:
LOCAL_STATIC_ANDROID_LIBRARIES += \
androidx.viewpager2_viewpager2
无法使用 MMA 命令构建代码并给出以下错误。
ninja: error: 'out/target/common/obj/JAVA_LIBRARIES/androidx.viewpager2_viewpager2_intermediates/package-res.apk', needed by 'out/target/product/apps/obj/APPS/app_intermediates/package-res.apk', missing and no known rule to make it
05:31:24 ninja failed with: exit status 1
failed to build some targets (05:38 (mm:ss))
如何将 androidx.viewpager2 添加到 Android.mk Makefile。
您必须将 viewpager2-1.0.0.aar 添加到 LOCAL_STATIC_JAVA_LIBRARIES
(或 LOCAL_STATIC_JAVA_AAR_LIBRARIES
)中。
使用 Android.mk 文件中的 .AAR 库文件将以下块添加到 support/sync
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
.
.
LOCAL_PACKAGE_NAME := App_Name
.
LOCAL_PRIVATE_PLATFORM_APIS := true
.
LOCAL_STATIC_JAVA_LIBRARIES := AAR_file-alias
.
include $(BUILD_PACKAGE)
include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := AAR_file-alias:lib_path/AAR_file.aar
include $(BUILD_MULTI_PREBUILT)