如何在发布应用到Play商店时处理.so文件?

huangapple go评论90阅读模式
英文:

How to deal with the .so file while publishing the app on the Play store?

问题

我创建了一个应用程序的发布版本,其中包含AS3.5.1中的Java和C++代码,并使用默认的Gradle进行构建。在上传应用程序后,我遇到了根据Google的说明上传原生代码zip文件的问题。(我的文件结构与Google页面上描述的文件结构不匹配-https://developer.android.com/studio/build/shrink-code#native-crash-support,我没有名为Universal的文件夹,然后在上传obj文件夹以zip形式时,Google简单地通知这些文件无效-path: app\build\intermediates\cmake\release\obj)。
我遇到的错误是:
原生调试符号包含一个无效的目录obj。仅支持Android ABI。也许我无法理解ABI(应用程序二进制接口)。

英文:

I created release version of app that has java and cpp code in AS3.5.1 with its default gradle. After uploading the app I am facing issues of uploading zip file of native code as per the Google instructions. ( My file structure is not a matching with the file structure described on Google page - https://developer.android.com/studio/build/shrink-code#native-crash-support, I dont have folder named Universal and then after uploading the obj folder in zip form Google simply notifies that these files are not valid -path: app\build\intermediates\cmake\release\obj).
I am getting the error as
The native debug symbols contain an invalid directory obj. Only Android ABIs are supported. May be I am not able to understand ABIs (Application Binary Interfaces).

答案1

得分: 2

在将我的目标文件上传到Google Play时,我遇到了相同的问题。原来问题在于解压缩zip文件后的层次结构与Google Play的处理器所期望的不同。您需要确保支持的架构目录都位于zip文件的根目录下。此外,您需要确保没有其他可能出现在zip文件中的隐藏系统文件(例如,如果在Mac上进行此操作,则是.DS_Store文件)。
在我的Mac上:进入所需的obj目录(对我来说是app/build/intermediates/cmake/release/obj),然后运行

zip -r symbols.zip x86* arm*

这将包括32位和64位的x86和arm架构,这是我在撰写时所需的全部内容。然后上传symbols.zip文件,就应该可以正常工作。

英文:

I had the same issue when uploading my object files to Google Play. Turns out the issue was that when decompressed the zip file hierarchy was not what Google Play's processor was expecting. You need to make sure that the directories for the supported architectures are all at the root of the zip file. Also you need to make sure there are no other hidden system files that might end up in the zip file (e.g. .DS_Store if doing this on Mac).
On my Mac: Navigate into the required obj directory (app/build/intermediates/cmake/release/obj for me) and run

zip -r symbols.zip x86* arm*

This will include the 32-bit and 64-bit x86 and arm architectures, which is all I need at time of writing. Then upload the symbols.zip file and it should work.

huangapple
  • 本文由 发表于 2020年10月23日 20:53:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/64500418.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定