请选择 进入手机版 | 继续访问电脑版
帖子
帖子
用户
博客
课程

如何编译64位版本的Android应用

YonBuilder移动开发 2022-4-22 10:02 441人浏览 63人回复
原作者: 常山赵子云 收藏 邀请
摘要

此前,为减小APK安装包大小,APICloud云编译默认只保留了armeabi或armeabi-v7a的so库。 自2019年8月1日起,Google Play要求APK必须包含64位so库,否则将被拒绝上架。 2021新增:国内主流手机厂商的应用市场也于202 ...

此前,为减小APK安装包大小,APICloud云编译默认只保留了armeabi或armeabi-v7a的so库。

自2019年8月1日起,Google Play要求APK必须包含64位so库,否则将被拒绝上架

2021新增:国内主流手机厂商的应用市场也于2021年4月发布了同样的要求,适配截止最早时间是2021年12月底

您的应用可通过在config中配置android_abi字段,支持编译64位so库到APK,以适配Google Play、小米、VIVO等应用市场政策。

一、如何操作:
1、config中配置:<preference name="android_abi" value="arm64-v8a"/>
2、提交config文件
3、重新云编译即可

编译后的apk包中将同时包含armeabi(32位或模拟64位)和arm64-v8a(64位)so库。

2022新增:

如果你的app希望仅编译 arm64-v8a(64位)排除32位,可在一的基础上:


1、下载附件中的 manifest.xml,并将其拷贝至你的项目 widget/res目录下,
2、往manifest.xml中新增节点:<application name="android_abi" value="arm64-v8a"/>
3、提交代码,重新云编译即可。

编译后的apk中将仅包含arm64-v8a(64位)so库(因2017年之前的一些第模块并非谷歌标准模块,必须进行一的操作,才能确保64位库被编译到apk中)。

注意:此操作须慎重,编译后需使用64位CPU手机做充分的测试。(华为,小米等较新上市的4/8核手机基本都是64位)
目前模块商店大部分的第三方SDK模块已完成64位版本so库的提供。如果你的app编译了64位版本,而对应的模块还未提供64位库,将导致app运行崩溃,如遇到该问题,请及时反馈,APICloud官方将优先协调对应的模块开发者进行升级。

关于manifest.xml的更多使用,请参考:
>APP动态权限及Android平台targetSdkVersion设置   
>如何解决“此应用专为旧版Android打造”问题   
>APP隐私政策实践

评论
441人参与,63条评论

精彩评论
  • 桔子贝壳 实习司机 89Y币
    发表于 2019-7-23 15:05
    收到                              
  • 辉哥_0808 老司机 12634Y币
    发表于 2019-7-23 16:31
    支持
  • backpack 马路杀手 951Y币
    发表于 2019-7-23 17:39
    还不太敢动!不晓得支持的模块进度如何了?
  • Mr.ZhouHeng 老司机 13184Y币
    发表于 2019-7-23 20:12
    啦啦
  • Issac 转正司机 1820Y币
    发表于 2019-7-23 20:59
    噢咖
  • angelshelter 半专业车手 2237Y币
    发表于 2019-7-23 21:40
    可以迪哇。
  • backpack 马路杀手 951Y币
    发表于 2019-7-24 11:24
    标记一下马上就用到了
  • VvVv1o 职业车手 1322Y币
    发表于 2019-7-24 13:38
    厉害了
  • 52yaoer 老司机 5750Y币
    发表于 2019-7-24 14:06
    收到
  • johnny'abcd 驾校小白 16Y币
    发表于 2019-7-24 16:33
    pdf reader 模块
  • feifei_g 驾校小白 1Y币
    发表于 2019-7-24 18:28

    还不太敢动!不晓得支持的模块进度如何了?
  • 飞翔的翔 职业车手 9404Y币
    发表于 2019-7-24 21:56
    先观望一下
  • 伤城 马路杀手 370Y币
    发表于 2019-7-30 11:27
    alivcLivePusher与alivcLivePlayer在适配后没办法直播的,请尽快适配
  • 嗨起1 驾校小白 1Y币
    发表于 2019-8-1 15:41






    支持
  • RII15 马路杀手 363Y币
    发表于 2019-8-1 16:00
    本帖最后由 RII15 于 2019-8-1 16:04 编辑

    發現問題:

  • RII15 马路杀手 363Y币
    发表于 2019-8-1 16:02
    20190801整理後發現:
    有問題的模塊
    模塊:NVNavigationBar
    問題:看不到文字,文字與背景成同一個顏色了

    ipad 分享會閃退
    模塊:shareAction       
    錯誤訊息:
    Exception name:NSGenericException Exception reason:Your application has presented a UIActivityViewController (<UIActivityViewController: 0x12528e200>). In its current trait environment, the modalPresentationStyle of a UIActivityViewController with this style is UIModalPresentationPopover. You must provide location information for this popover through the view controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the view controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation. Exception stack 0 CoreFoundation 0x000000022e6d8294 <redacted> + 252 1 libobjc.A.dylib 0x000000022d8b29f8 objc_exception_throw + 56 2 UIKitCore 0x000000025a554a50 <redacted> + 2740 3 UIKitCore 0x000000025a55d2b8 <redacted> + 2176 4 UIKitCore 0x000000025a55ae04 <redacted> + 464 5 UIKitCore 0x000000025abdfdec <redacted> + 296 6 UIKitCore 0x000000025abce93c <redacted> + 352 7 UIKitCore 0x000000025abfb7ac <redacted> + 116 8 CoreFoundation 0x000000022e6695f8 <redacted> + 32 9 CoreFoundation 0x000000022e664320 <redacted> + 412 10 CoreFoundation 0x000000022e66489c <redacted> + 1228 11 CoreFoundation 0x000000022e6640b0 CFRunLoopRunSpecific + 436 12 GraphicsServices 0x000000023086479c GSEventRunModal + 104 13 UIKitCore 0x000000025abd4978 UIApplicationMain + 212 14 UZApp 0x0000000100996a80 UZApp + 879232 15 libdyld.dylib 0x000000022e1298e0 <redacted> + 4 )
    Exception name:NSSignalException Exception reason:Signal SIGABRT was raised! Exception stack "0 UZApp 0x000000010098ec48 UZApp + 846920", "1 UZApp 0x000000010098e7b8 UZApp + 845752", "2 libsystem_platform.dylib 0x000000022e2e89dc <redacted> + 40", "3 libsystem_pthread.dylib 0x000000022e2ee094 <redacted> + 380", "4 libsystem_c.dylib 0x000000022e1ceea8 abort + 140", "5 libc++abi.dylib 0x000000022d89b788 __cxa_bad_cast + 0", "6 libc++abi.dylib 0x000000022d89b934 <redacted> + 0", "7 libobjc.A.dylib 0x000000022d8b2e00 <redacted> + 124", "8 libc++abi.dylib 0x000000022d8a7838 <redacted> + 16", "9 libc++abi.dylib 0x000000022d8a7434 __cxa_rethrow + 144", "10 libobjc.A.dylib 0x000000022d8b2bc8 objc_exception_rethrow + 44", "11 CoreFoundation 0x000000022e66411c CFRunLoopRunSpecific + 544", "12 GraphicsServices 0x000000023086479c GSEventRunModal + 104", "13 UIKitCore 0x000000025abd4978 UIApplicationMain + 212", "14 UZApp 0x0000000100996a80 UZApp + 879232", "15 libdyld.dylib 0x000000022e1298e0 <redacted> + 4" )
  • RII15 马路杀手 363Y币
    发表于 2019-8-2 16:25
    今天進行依說明進行處理:
    如何操作:
    1、config中配置:<preference name="android_abi" value="arm64-v8a"/>
    2、提交config文件
    3、使用升级环境编译即可

    程序因之前出現過:HostnameVerifier
    APICLoud建意用[ 邦邦加固 ]進行解決!
    而本次處理這個64位元的處理,再用[ 邦邦加固 ]加固後提示程序為32位!
    所以這邊再次上傳沒有加固的程序,就沒有提示為32位,但是這會不會審核後又出現HostnameVerifier的問題?
  • TanmoyM 驾校小白 12Y币
    发表于 2019-8-7 17:11
    本帖最后由 TanmoyM 于 2019-8-7 18:11 编辑

    <preference name="android_abi" value="arm64-v8a"/>

    added this to config.xml. But the build has been rejected by google again.
    built with upgraded environment

    android version for which I build was 4.4W.2 (any newer version in the settings produces the apk-file with multiple dex-files, which is also the reason for google to reject).

    Any other suggestions please?



    Error from GOOGLE:

    This release is not compliant with the Google Play 64-bit requirement

    The following APKs or App Bundles are available to 64-bit devices, but they only have 32-bit native code: 253.

    Include 64-bit and 32-bit native code in your app. Use the Android App Bundle publishing format to automatically ensure that each device architecture receives only the native code it needs. This avoids increasing the overall size of your app. Learn More



  • hanyucq 业余车手 1642Y币
    发表于 2019-8-8 12:25
    RII15 发表于 2019-8-2 16:25
    今天進行依說明進行處理:
    如何操作:
    1、config中配置:

    所以你过了没老哥

查看全部评论>>