APP在源码中编译失败问题
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
参考:https://blog.csdn.net/kris_fei/article/details/88660382
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!