Failure [INSTALL_FAILED_INVALID_APK]
时间: 2023-10-16 14:08:19 浏览: 267
Installation failed with message Failed to finalize session : INSTALL_FAILED_INVALID_APK: /data/app/
5星 · 资源好评率100%
Failure \[INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2\] 这个错误提示表明在安装apk时无法提取本地库文件,导致安装失败。根据你提供的引用内容,这个问题可能是由于Androidmanifest文件的application节点的android:extractNativeLibs属性被设置为false导致的。这个属性控制是否在打包时对so库进行压缩,并使用zipalign进行对齐操作。如果设置为false,那么本地库必须是页面对齐的,并且以未压缩的形式存储在APK中。在这种情况下,不需要进行代码更改,链接器会在运行时直接从APK中加载库文件。\[1\]\[2\]
为了解决这个问题,你可以尝试将android:extractNativeLibs属性设置为true,或者确保本地库文件是页面对齐的并以未压缩的形式存储在APK中。另外,你还可以检查设备上的相关开关,确保不会进行安装鉴权,以避免安装失败。\[3\]这样应该能够解决你遇到的问题。
#### 引用[.reference_title]
- *1* [安装APK提示Failure [INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2]](https://blog.csdn.net/wxz1179503422/article/details/126956265)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Failure [INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2]](https://blog.csdn.net/m0_46168982/article/details/119988030)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [用adb 安装(install) apk 的时候报错 “Failure [INSTALL_FAILED_INVALID_APK]](https://blog.csdn.net/Builder_Taoge/article/details/123171499)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文