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

高版本SDK编译生成的apk放入低版本android源码中集成编译会报如下错误:

高版本SDK编译生成的apk放入低版本android源码中集成编译_第1张图片

 

[ 33% 1/3] Install: out/target/product/msm8909/system/app/Lottery/Lottery.apk
[ 66% 2/3] build out/target/product/msm8909/obj/APPS/Lottery_intermediates/oat/arm/package.odex
FAILED: /bin/bash -c "(rm -f out/target/product/msm8909/obj/APPS/Lottery_intermediates/oat/arm/package.odex ) && (mkdir -p out/target/product/msm8909/obj/APPS/Lottery_intermediates/oat/arm/ ) && (ANDROID_LOG_TAGS=\"*:e\" out/host/linux-x86/bin/dex2oatd --runtime-arg -Xms64m --runtime-arg -Xmx512m --runtime-arg -classpath --runtime-arg \"&\" --boot-image=out/target/product/msm8909/dex_bootjars/system/framework/boot.art --dex-file=packages/apps/Lottery/Lottery.apk --dex-location=/system/app/Lottery/Lottery.apk --oat-file=out/target/product/msm8909/obj/APPS/Lottery_intermediates/oat/arm/package.odex --android-root=out/target/product/msm8909/system --instruction-set=arm --instruction-set-variant=cortex-a7 --instruction-set-features=default --include-patch-information --runtime-arg -Xnorelocate --no-generate-debug-info --abort-on-hard-verifier-error --no-inline-from=core-oj.jar   --compile-pic )"
dex2oatd F  4669  4675 art/runtime/class_linker.cc:6620] Check failed: vtable_entry != other_entry && !name_comparator.HasSameNameAndSignature( other_entry->GetInterfaceMethodIfProxy(pointer_size)) vtable entries 1047 and 1052 are identical for java.lang.Class in method int android.support.v7.widget.DropDownListView.lookForSelectablePosition(int, boolean) and int android.support.v7.widget.MenuPopupWindow$MenuDropDownListView.lookForSelectablePosition(int, boolean)
dex2oatd F 4669 4675 art/runtime/runtime.cc:422]Runtime aborting...
Aborting thread:

 

 

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := Lottery
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_SRC_FILES := Lottery.apk
LOCAL_DEX_PREOPT := false
LOCAL_PRIVILEGED_MODULE := true
LOCAL_CERTIFICATE := platform
LOCAL_MODULE_PATH := $(TARGET_OUT_APPS)
include $(BUILD_PREBUILT)

 

原因是apk要预置进源码的时候,会对apk进行一个解析,好形成odex文件加速apk的运行,

但是基于高版本的sdk开发的apk里面的一些资源是无法被低版本正确的解析的,解决办法就是,在mk文件里面禁止对该apk进行odex的处理。

LOCAL_DEX_PREOPT := false

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