[RK3399][Android7.1] 调试笔记 --- 编译出来的APP在源码中编译失败问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kris_fei/article/details/88660382

Platform: RK3399
OS: Android 7.1
Kernel: v4.4.83

背景:
APK是通过Android Studio使用高版本的SDK Version(API Level 28)编译生成的,然后被放到了Android源码(API Level 25)中当作第三方APK来编译,编译出错。


Error Log:

[ 35% 105/294] build out/target/product/rk3399_mid/obj/APPS/BenebotHumanInterAction1.0.AudioService_intermediates/oat/arm64/package.odex
FAILED: /bin/bash -c "(rm -f out/target/product/rk3399_mid/obj/APPS/BenebotHumanInterAction1.0.AudioService_intermediates/oat/arm64/package.odex ) && (mkdir -p out/target/product/rk3399_mid/obj/APPS/BenebotHumanInterAction1.0.AudioService_intermediates/oat/arm64/ ) && (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/rk3399_mid/dex_bootjars/system/framework/boot.art --dex-file=device/rockchip/rk3399/benebot/BenebotHumanInterAction1.0.AudioService.apk --dex-location=/system/etc/benebot/BenebotHumanInterAction1.0.AudioService/BenebotHumanInterAction1.0.AudioService.apk --oat-file=out/target/product/rk3399_mid/obj/APPS/BenebotHumanInterAction1.0.AudioService_intermediates/oat/arm64/package.odex --android-root=out/target/product/rk3399_mid/system --instruction-set=arm64 --instruction-set-variant=cortex-a53 --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 19250 19376 art/runtime/class_linker.cc:6620] Check failed: vtable_entry != other_entry && !name_comparator.HasSameNameAndSignature( other_entry->GetInterfaceMethodIfProxy(pointer_size)) vtable entries 1049 and 1054 are identical for java.lang.Class<android.support.v7.widget.MenuPopupWindow$MenuDropDownListView> in method int android.support.v7.widget.DropDownListView.lookForSelectablePosition(int, boolean) and int android.support.v7.widget.MenuPopupWindow$MenuDropDownListView.lookForSelectablePosition(int, boolean)
dex2oatd F 19250 19376 art/runtime/runtime.cc:422]Runtime abortin


原因:

源码编译会对apk进行一个解析,形成odex文件加速apk的运行,但是基于高版本的SDK开发的APK里的一些资源是无法被低版本正确的解析。


解决方法:
要编译APK的Android.mk文件中添加如下一行:
LOCAL_DEX_PREOPT := false


参考:
关于AS高版本SDK编译生成的apk放入低版本android源码中集成编译

猜你喜欢

转载自blog.csdn.net/kris_fei/article/details/88660382