Linux install aapt: error while loading shared libraries: libc++.so: file too short

本文详细介绍了解决Android应用打包过程中遇到的'aapt error while loading shared libraries: /lib/x86_64-linux-gnu/libc++.so: file too short'问题的方法,包括下载并安装SDK Platform Tools,配置LD_LIBRARY_PATH,以及如何通过aapt2验证修复过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1、问题现象

aapt: error while loading shared libraries: /lib/x86_64-linux-gnu/libc++.so: file too short
提示找不到类库

2、解决方法一

	1、下载 SDK Platform Tools 包 [SDK Platform Tools ](https://developer.android.google.cn/studio/releases/platform-tools?hl=zh-cn)
 	2、解压 SDK Platform Tools 包,在里面找到 lib64目录中有 libc++.so 文件
 	3、安装 libc++.so 文件
 		参考文档:[Linux中error while loading shared libraries错误解决办法](https://blog.youkuaiyun.com/smilejiasmile/article/details/84307527)
 		1、首先打开/etc/ld.so.conf文件
 		2、加入动态库文件所在的目录:执行vi /etc/ld.so.conf,在"include ld.so.conf.d/*.conf"下方增加"/usr/local/lib"。
 		3、将 libc++.so 文件拷贝至 /usr/local/lib 此目录中
 		4、/sbin/ldconfig -v 执行此命令 立即加载类库文件,不用重启系统

解决方法二

	安装 aapt2 [aapt2](https://developer.android.google.cn/studio/command-line/aapt2?hl=en#download_aapt2)

3、测试

	执行 aapt 命令是否正常
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值