简体   繁体   English

在64位Android设备上从Google Play商店安装应用时,如果该应用支持,该应用是否以64位安装?

[英]When installing an app from the Google Play store on a 64-bit Android device, does the app install as 64-bit if the app supports it?

The reason I ask is related to Google's recent communication https://developer.android.com/distribute/best-practices/develop/64-bit regarding apps needing to support 64-bit devices. 我问的原因与Google最近关于需要支持64位设备的应用程序的通信https://developer.android.com/distribute/best-practices/develop/64-bit有关。 I am pretty confident my app supports 64-bit devices based on the suggestions mentioned in the article. 我非常有信心根据本文中提到的建议,我的应用程序支持64位设备。 When I install it from Google Play, it works exactly as expected, however when I test the APK locally using the ADB command on 64-bit hardware (as Google suggested in this section 'Test your app on 64-bit hardware'), my app has UI issues. 当我从Google Play安装它时,它完全可以按预期运行,但是,当我在64位硬件上使用ADB命令在本地测试APK时(如Google在本节“在64位硬件上测试您的应用”中所建议的),应用程式存在UI问题。 I'm not sure why it's behaving inconsistently. 我不确定为什么它的表现不一致。

Is it possible that somehow the 32-bit version is being installed when using Google Play and therefore works fine? 使用Google Play时是否可能以某种方式安装了32位版本,因此工作正常? I'm concerned my app may actually have problems when truly installed as 64-bit, so any clarification on the inconsistencies described above would be appreciated. 我担心我的应用程序在真正安装为64位时实际上可能会遇到问题,因此请您对上述不一致之处做任何澄清。

The device I'm testing with is a 'Moto X Pure Edition' running Android 7.0. 我正在测试的设备是运行Android 7.0的“ Moto X Pure Edition”。 It has a Snapdragon 808 CPU which uses ARM architecture. 它具有使用ARM架构的Snapdragon 808 CPU。 On the other hand, we don't see any '/lib' folder as the Google article suggests to check. 另一方面,我们没有看到Google文章建议检查的'/ lib'文件夹。 Our app is hybrid, built with Ionic v3. 我们的应用程序是混合的,使用Ionic v3构建。

There is no such thing as "installing as 32 bit" or "installing as 64 bit". 没有“以32位安装”或“以64位安装”之类的东西。 I'll try to explain. 我会尽力解释。 This gets a little complicated, and you don't provide many details about your app. 这变得有些复杂,并且您没有提供有关应用程序的许多详细信息。 There are a few possibilities for how you have chosen to build your app. 您有几种选择来构建应用程序的可能性。

  1. You have no native code in your app (no .so libraries). 您的应用程序中没有本机代码(没有.so库)。 It was written entirely in Java or Kotlin, and none-of the third party libraries you use use native code either. 它完全是用Java或Kotlin编写的,您使用的第三方库都不使用本机代码。 In this case the lib/ subdirectory of your APK you'd expect to be empty. 在这种情况下,您希望APK的lib/子目录为空。
  2. You do have native code in your app, but you have .so files (libraries) for all ABIs . 您的应用程序中确实有本机代码,但是所有ABI都有.so文件(库)。 In this case in your APK you'd expect to see multiple subdirectories under lib/ in your APK, with names like x86 , armeabi-v7a , etc 在这种情况下,您可能希望在APK中看到APK中lib/下的多个子目录,其名称为x86armeabi-v7a
  3. You have native code in your app, but you are relying on ABI compatibility to work. 您的应用程序中包含本机代码,但是您依赖ABI兼容性来工作。 That is your lib/ directory contains just armeabi-v7a as a subdirectory. 那就是您的lib/目录仅包含armeabi-v7a作为子目录。 x86, x86-64 and 64 bit ARM all emulate 32 bit ARM. x86,x86-64和64位ARM都模拟32位ARM。
  4. You have made more than one APK for each release of your app, one for each ABI. 您为每个版本的应用制作了一个以上的APK,为每个ABI制作了一个。 The is usually called multi-APK . 通常称为multi-APK So there is one for 64 bit ARM, one for 32 bit ARM, one for X86, one for X86 64 bit, etc. 因此,有一个用于64位ARM,一个用于32位ARM,一个用于X86,一个用于X86 64位,等等。
  5. You use the Android App Bundle , and let Google Play choose how to deliver your app. 您使用Android应用程序捆绑包 ,然后让Google Play选择如何交付您的应用程序。

By the way, I'd strongly recommend 5 as an option, it makes it much more likely the right thing will happen. 顺便说一句,我强烈建议您选择5,这样可以使正确的事情发生的可能性更大。

In the case of 1, 32 bit or 64bit doesn't matter. 在1的情况下,32位或64位无关紧要。 Any UI issues are caused by something else. 任何UI问题都是由其他原因引起的。 Maybe the 64 bit phone allocates a bit more memory and your app doesn't perform well in low memory. 也许64位手机分配了更多的内存,而您的应用在内存不足的情况下表现不佳。 Maybe the 64 bit phone is a bit faster and you've written your code with race conditions. 也许64位手机要快一些,并且您已经在竞争条件下编写了代码。 Whatever it is, 64 vs 32 bit isn't the root cause. 无论是64位还是32位并不是根本原因。

In the case of 2, Google Play installs the same APK to every phone. 如果是2,则Google Play会在每部手机上安装相同的APK。 But the device itself chooses which library (.so file) to load based on the processor. 但是设备本身会根据处理器选择要加载的库(.so文件)。 If one of your libraries was buggy on 64 bit that could be the issue. 如果您的一个库在64位上有错误,可能就是问题所在。

In the case of 3, this is what Google's latest blog post is trying to stop. 在3的情况下,这就是Google最新博客文章试图阻止的内容。 This won't be allowed to be published for new APKs. 不允许将其发布为新的APK。 You need to properly support 64 bit devices by adding 64 bit native libraries. 您需要通过添加64位本机库来正确支持64位设备。 If this was the case, you could get bad UI performance by having the device emulate 32 bit arm on a 64 bit (possibly X86) device. 如果是这种情况,通过使设备在64位(可能是X86)设备上模拟32位臂,可能会导致UI性能下降。 You should switch to some other option, I'd recommend 5. This might not be you by the way, it might be some 3rd party library you depend on. 您应该切换到其他选项,我建议5。顺便说一下,这可能不是您,它可能是您依赖的某些第三方库。

In the case of 4, Google Play does install different APKs to different devices based on processor type. 在4的情况下,Google Play会根据处理器类型在不同的设备上安装不同的APK。 Each different APK has a different version code. 每个不同的APK都有不同的版本代码。 The device with a 64 bit processor will get the APK with the 64 bit libraries. 具有64位处理器的设备将获得具有64位库的APK。 If you are testing by putting the 32 bit version code on the 64 bit device using adb, you could indeed get bugs. 如果通过使用adb将32位版本代码放在64位设备上进行测试,则确实可能会出现错误。 However, if you were building and publishing different APKs for different APIs you would know it. 但是,如果您要针对不同的API构建和发布不同的APK,您就会知道。 Just install the right version code with adb . 只需使用adb安装正确的版本代码。

In the case of 5, Google will install different APKs (in fact multiple different APK splits) to different devices. 在5的情况下,Google会将不同的APK(实际上是多个不同的APK分割)安装到不同的设备上。 To test it, I'd recommend using a Google Play internal test track to verify to check exactly the right parts are installed which match Google Play. 要对其进行测试,建议您使用Google Play内部测试轨道进行验证,以检查是否已正确安装与Google Play匹配的正确零件。

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

相关问题 此版本符合 Google Play 64 位原生应用的要求 - This release is compliant with the Google Play 64-bit requirement native app Google Play 64 位要求 App bundle 更新失败 - Google Play 64-bit requirement App bundle failed to update 如何构建符合 Google Play 64 位要求的应用程序? - How to build app compliant with Google Play 64-bit requirement? 谷歌警告开发者要为Android应用程序添加64位版本 - Google warns developer to include 64-bit version for Android app 由于缺少 64 位库,无法构建 64 位版本的 Ionic Android App - Can't build 64-bit version of Ionic Android App due to missing 64-bit library Android 应用程序,如何支持 64 位架构? - Android app, How to support 64-bit architectures? 使用 Libgdx 为 64 位设备更新 android 应用程序 - Updating android app with Libgdx for 64-bit devices Android 64 位 Delphi 应用程序部署期间出错 - Error during Android 64-bit Delphi app deployment 如何构建符合Google Play 64位要求的NativeScript Vue应用程序? - How to build NativeScript Vue app compliant with Google Play 64-bit requirement? 此版本不符合Google Play 64位要求。 本机Java应用程序已经存在所有.so - This release is not compliant with the Google Play 64-bit requirement. All .so already exists for native java app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM