AS高版本SDK编译生成的apk放入低版本android源码中集成编译错误

android系统中内置app:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

# Module name should match apk name to be installed

LOCAL_MODULE := Demo

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(LOCAL_MODULE).apk

LOCAL_MODULE_CLASS := APPS

LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)

LOCAL_CERTIFICATE := PRESIGNED

LOCAL_PRIVILEGED_MODULE := false

LOCAL_MODULE_TARGET_ARCH := arm

LOCAL_DEX_PREOPT := false

LOCAL_PREBUILT_JNI_LIBS_arm := \

    @lib/armeabi-v7a/libdemo.so \

    @lib/armeabi-v7a/libbug.so \

LOCAL_MULTILIB := 32

include $(BUILD_PREBUILT)

内置后一直报:Verification error in 和Had a hard failure verifying all classes, and was asked to abort in such situations.

找到原因:apk要预置进源码的时候,会对apk进行一个解析,会生成odex文件用于加快apk的运行,但是基于高版本的sdk开发的apk里面的一些资源是无法被低版本正确的解析的,解决的范式是在mk文件里面不对该apk进行odex的处理。LOCAL_DEX_PREOPT := false

你可能感兴趣的:(AS高版本SDK编译生成的apk放入低版本android源码中集成编译错误)