1. 程式人生 > >android p make 編譯lib靜態庫報錯

android p make 編譯lib靜態庫報錯

如下是8.1到9.0版本編譯出現問題

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.

8.1版本 make編譯本地靜態jar方式如下

第一步

LOCAL_STATIC_JAVA_LIBRARIES := \
    android-support-v4 \
    android-support-v7-recyclerview \
    android-support-v13 \
    evie_side_screen

//這是本地jar包

第二步

include $(CLEAR_VARS)

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := evie_side_screen:libs/evie-side-screen-library.jar

android p make編譯本地靜態jar方式如下

第一步(不變)

LOCAL_STATIC_JAVA_LIBRARIES := \
    android-support-v4 \
    android-support-v7-recyclerview \
    android-support-v13 \
    evie_side_screen

//這是本地jar包

第二步

include $(CLEAR_VARS)
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
LOCAL_MODULE := evie_side_screen
LOCAL_SRC_FILES := libs/evie-side-screen-library.jar
LOCAL_UNINSTALLABLE_MODULE := true
include $(BUILD_PREBUILT)

 

andrioid p make hide介面報錯

LOCAL_SDK_VERSION 和 LOCAL_PRIVATE_PLATFORM_APIS 只能定義一個
LOCAL_SDK_VERSION  編譯時影藏 @hide的API   
 LOCAL_PRIVATE_PLATFORM_APIS : = true會使用sdk的hide的api來編譯