我正在尝试使用android-support-design
库(因为我使用了来自支持设计库的FAB。)用于我的一个应用程序。我尝试使用Android.mk下面构建它
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat
LOCAL_STATIC_JAVA_LIBRARIES += android-support-design-res
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res frameworks/support/v7/appcompat/res frameworks/support/design/res
LOCAL_PACKAGE_NAME := TestApp
LOCAL_AAPT_FLAGS := \
--auto-add-overlay \
--extra-packages android.support.v7.appcompat \
--extra-packages android.support.design
include $(BUILD_PACKAGE)
但我总是得到这个错误:
make: *** No rule to make target `out/target/common/obj/JAVA_LIBRARIES/android-support-design-res_intermediates/javalib.jar', needed by `out/target/common/obj/APPS/TestApp/classes-full-debug.jar'. Stop.
有人可以帮我解决这个问题。
答案 0 :(得分:0)
我也遇到了同样的问题。
也许你的mk错了。
我解决了这个问题。
一种方式:
mmm frameworks/support/design/
mmm your app
其他方式:
使用制作命令
例如
make -j4 TestApp
我的Android.mk是
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 android-support-design android-support-v7-appcompat
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := \
$(call all-java-files-under, src)
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \
frameworks/support/v7/appcompat/res \
frameworks/support/design/res
LOCAL_PACKAGE_NAME := MyDemo
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_AAPT_FLAGS := \
--auto-add-overlay \
--extra-packages android.support.design \
--extra-packages android.support.v7.appcompat
include $(BUILD_PACKAGE)