简体   繁体   English

zipalign:加载共享库时出错:libc ++。所以:无法打开共享对象文件:没有这样的文件或目录

[英]zipalign: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory

I am trying to build android app. 我正在尝试构建Android应用程序。 When I run the zip align tool to optimize the APK, I get this error message: 当我运行zip对齐工具来优化APK时,我收到以下错误消息:

zipalign: error while loading shared libraries: libc++.so: cannot open shared object file: No such file or directory

I tried to install libc++ 我试着安装libc ++

sudo aptitude install libc++

it says: Couldn't find package "libc+". 它说:找不到包“libc +”。

Snapshot of my terminal 我终端的快照

我终端的快照

If your system is 64-bits, there should be a folder lib64 on the path of 如果您的系统是64位,则路径上应该有一个文件夹lib64

 [android-path]/build-tools/[version]/

The files in lib64 are lib64中的文件是

[ec2-user 25.0.2]$ ll lib64/
total 51628
-rwxrwxrwx 1 ec2-user ec2-user 30712616 Dec 23 07:22 libLLVM.so
-rwxrwxrwx 1 ec2-user ec2-user   482522 Dec 23 07:22 libbcc.so
-rwxrwxrwx 1 ec2-user ec2-user   433914 Dec 23 07:22 libbcinfo.so
-rwxrwxrwx 1 ec2-user ec2-user  1211614 Dec 23 07:22 libc++.so
-rwxrwxrwx 1 ec2-user ec2-user 20019608 Dec 23 07:22 libclang.so

Just copy the folder lib64 and zipalign program together to the destination path, and you can run the zipalign correctly. 只需将文件夹lib64和zipalign程序一起复制到目标路径,即可正确运行zipalign。

It worked for me. 它对我有用。 I guess the zipalign has a dependency on the files in lib64 folder. 我想zipalign依赖于lib64文件夹中的文件。

I met the same problems and google it. 我遇到了同样的问题并谷歌。 You can try the following suggestions: 您可以尝试以下建议:

  1. If you are in 64-bit environment, try: sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev. 如果您在64位环境中,请尝试:sudo apt-get install lib32stdc ++ 6 lib32z1 lib32z1-dev。
  2. Update the latest android sdk tools and do not move the zipalign binary to any other folder. 更新最新的android sdk工具,不要将zipalign二进制文件移动到任何其他文件夹。 It solve my problem. 它解决了我的问题。

I had the exact same problem and it was probably because I moved the zipalign binary from <android-path>/build-tools/23.0.3 to <android-path>/tools . 我有完全相同的问题,这可能是因为我将zipalign二进制文件从<android-path>/build-tools/23.0.3<android-path>/tools

The solution is to add the build-tools/23.0.3 dir to your path: 解决方案是将build-tools/23.0.3目录添加到您的路径:

export PATH=${PATH}:<android-path>/build-tools/23.0.3

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在64位Ubuntu 12.04上运行aapt:加载共享库时出错:libc ++。所以:没有这样的文件或目录 - Running aapt on 64-bit Ubuntu 12.04: error while loading shared libraries: libc++.so: No such file or directory clang:加载共享库时出错:libtinfo.so.5:无法打开共享对象文件:没有这样的文件或目录 - clang: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory adb:加载共享库时出错:libncurses.so.5:无法打开共享对象文件:没有这样的文件或目录 - adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory 加载共享库时出错:libpulse.so.0:无法打开共享 object 文件:没有这样的文件或目录 - error while loading shared libraries: libpulse.so.0: cannot open shared object file: No such file or directory 是AOSP的libc ++。所以和NDK的libc ++ _ shared.so一样吗? - Is AOSP's libc++.so the same as NDK's libc++_shared.so? ADT - libstdc ++。so.6:无法打开共享对象文件 - ADT - libstdc++.so.6: cannot open shared object file libz.so.1: 无法打开共享对象文件 - libz.so.1: cannot open shared object file zipalign 错误“没有这样的文件或目录” - zipalign error “no such file or directory” Android SDK - aapt 错误:libstdc++.so.6 无法打开共享对象文件 - Android SDK - aapt error : libstdc++.so.6 cannot open shared object file 错误libGL.so:无法使用Android模拟器打开共享对象文件 - Error libGL.so: cannot open shared object file using Android emulator
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM