[英]Can't build Qt Application for Android for arm64-v8a, libc++.so.16 not found error is shown
When I try to build Qt app for Android for arm64-v8a device it shows me :-1: error: no such file or directory: '/Users/semyontikhonenko/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++.so.16'
When I try any other platform it's built successfully. 当我尝试为arm64-v8a设备构建适用于Android的Qt应用时,它显示给我:-1: error: no such file or directory: '/Users/semyontikhonenko/Library/Android/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++.so.16'
当我尝试其他平台时,它已成功构建。 I tried a workground from https://wiki.qt.io/Qt_for_Android_known_issues but it didn't help. 我从https://wiki.qt.io/Qt_for_Android_known_issues尝试了一个工作场所,但没有帮助。 This is how I did it: 这是我的方法:
It keeps on searching for libc++.so.16
even if the env var is set to 21. And even if you copy and rename a file so it can match, that only leads to a cascade of other errors. 即使将env var设置为21,它也会继续搜索libc++.so.16
。即使您复制并重命名文件以使其可以匹配,也只会导致其他错误。
The version it tries to find doesn't seem to be tied to that env var, but to the project minimum API requirement setting. 它尝试查找的版本似乎并不与该环境变量相关,而是与项目的最低API要求设置相关。
For me it works if I set the env var to android-28
, and then set the project minimum required SDK to API 21. Generate a manifest template if you haven't, and edit that setting and it should work. 对我而言,如果将env var设置为android-28
,然后将项目所需的最低SDK设置为API 21,则可以使用。如果没有,请生成清单模板,然后编辑该设置,它应该可以工作。
Lower minimum APIs don't seem to work with v8a. 最低的最低API似乎不适用于v8a。 That makes sense, because 64bit android was introduced with version 5, which is API 21. Which also means you are not losing potential targets, as older versions don't support 64 bit binaries anyway. 这是有道理的,因为64位android是在API 5的第5版中引入的。这也意味着您不会失去潜在的目标,因为旧版本始终不支持64位二进制文件。
So if you want to target the 7-8% of market share between the Qt minimum requirement and API 21, you will have to use a v7a binary. 因此,如果您希望将Qt最低要求与API 21之间的7%的市场份额作为目标,则必须使用v7a二进制文件。 v8 is backward compatible with v7 tho, so you can use the v7a binary even on new android versions. v8与v7 tho向后兼容,因此您甚至可以在新的android版本上使用v7a二进制文件。 Google will begin mandating 64bit binaries in August 2019, so for the time being, there isn't much point in using v8a, unless you have an app that is supposed to address more than 4 gigs of memory, which is about twice the average total ram of phones sold this year. Google将于2019年8月开始强制执行64位二进制文件,因此暂时而言,使用v8a并没有多大意义,除非您的应用程序可以处理4多个以上的内存,这大约是平均总数的两倍今年售出的手机ram。 You can get away with a single binary that will work on all devices, which is not the case for v8a, which won't work on 32bit SOCs, even if the android version is 5 or above. 您可以摆脱一个可以在所有设备上运行的二进制文件的问题,对于v8a而言并非如此,即使Android版本为5或更高版本,v8a也无法在32位SOC上运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.