为Qt项目的多种架构生成APK [英] Produce an APK for multiple architectures for Qt projects

查看:336
本文介绍了为Qt项目的多种架构生成APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在3d派对APK文件中,我注意到有用于不同架构的文件夹-armv7,arm64,x86,mips-因此,一个APK适用于Android支持的多种架构.

In 3d party APK files I notice there are folders for different architectures - armv7, arm64, x86, mips - so a single APK works for multiple architectures, supported by Android.

但是,我似乎没有找到一种方法来解决Qt项目.我有一个针对多个体系结构的项目,但是一次只能为当前活动的项目工具包为一个体系结构生成一个APK.

However, I don't seem to find a way to do that with Qt projects. I have a project that targets multiple architectures, but I can only produce an APK for an architecture at a time, only for the currently active project kit.

是否可以为Qt项目生成这样的多拱形APK?

Is it possible to produce such a muti-arch APK for a Qt projects?

推荐答案

我找到了解决此问题的方法.当我的Qt应用程序必须符合Google为64位体系结构提供64位二进制文​​件的要求时,我遇到了这个问题.尽管此过程不是完全自动化,但可以.

I have found a work-around for this problem. I came across this problem when my Qt application had to comply to Google's requirement of providing 64 binaries for 64 bit architecture. Although this process is not totally automated but it works.

1-构建适用于不同架构的APK(在我的情况下为armeabi-v7a和arm64-v8a)

1- Build your APKs for different architectures(in my case armeabi-v7a and arm64-v8a)

2-打开所有APK以使用任何压缩/解压缩软件进行编辑(我使用了Ubuntu提供的默认设置.在Windows上可以使用WinRaR)

2- Open all APKs for editing with any compression/decompression software(I used the default provided by Ubuntu. On windows you can use WinRaR)

3-转到"lib"文件夹,然后复制以该架构命名的文件夹(arm64-v8a,armeabi-v7a等)

3- Go to "lib" folder and copy the folder named with the architecture (arm64-v8a, armeabi-v7a, etc.)

4-将步骤3中所有复制的文件夹合并到任何一个APK的lib文件夹中.现在,我们将使用此APK向前移动

4- Consolidate all the copied folders from step#3 into the lib folder of any one APK. Now we will use this APK to move forward

5-转到APK根目录上名为"META-INF"的文件夹并删除文件* .RSA和* .SF

5- Go to the folder named "META-INF" on APK root and delete files *.RSA and *.SF

6-现在关闭APK文件.

6- Now close the APK file.

7-转到 https://github.com/patrickfav/uber-apk-signer 并下载Jar文件.您可以使用此工具对文件进行zipalign并再次签名.按如下方式使用罐子.

7- Go to https://github.com/patrickfav/uber-apk-signer and download the Jar file. You can use this tool to zipalign and sign your package again. Use the jar as follows.

java -jar uber-apk-signer-1.0.0.jar --apks ./android-build-release-signed.apk --ks android_release.keystore --ksAlias your_certificate_alias

java -jar uber-apk-signer-1.0.0.jar --apks ./android-build-release-signed.apk --ks android_release.keystore --ksAlias your_certificate_alias

现在,您可以将最终的APK发布到Google Play.干杯!

Now you can publish the final APK to Google Play. Cheers!

这篇关于为Qt项目的多种架构生成APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆