为什么 Google Play 商店说我的 Android 应用程序与我自己的设备不兼容?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10475954/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 03:53:22  来源:igfitidea点击:

Why does the Google Play store say my Android app is incompatible with my own device?

androidgoogle-play

提问by Greg Hewgill

I am hesitant to ask this question, because it appears as though many people have a similar problemand yet I have found no solution that solves my particular instance.

我很犹豫要问这个问题,因为似乎很多人都有类似的问题,但我没有找到解决我的特定情况的解决方案。

I have developed an Android app (link to the actual app) and have uploaded it to the Play store. The Play store says

我开发了一个 Android 应用程序(链接到实际应用程序)并将其上传到 Play 商店。Play商店说

"This app is incompatible with your XT Mobile Network HTC HTC Wildfire S A510b."

"This app is incompatible with your XT Mobile Network HTC HTC Wildfire S A510b."

Of course that is the phone on which I developed the app, so it oughtto be compatible. Some people with other devices say that it reports compatible, others say it reports incompatible, but I can find no trend. (Apparently I don't know very many people with Android devices.)

当然,那是我开发应用程序的手机,所以它应该是兼容的。一些使用其他设备的人说它报告兼容,其他人说它报告不兼容,但我找不到任何趋势。(显然我不认识很多人使用 Android 设备。)

I have tried the following:

我尝试了以下方法:

  • moving a large-ish file out of the res/rawdirectory as suggested by this answer. The only file in there was a ~700 kB text file, but I moved it to assets/with no apparent change.

  • adding the following two feature assertions:

    <uses-feature android:name="android.hardware.faketouch" />
    <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
    

    thinking that maybe my phone doesn't claim to support the usual android.hardware.touchscreenfeature, but again, with no apparent change.

  • res/raw按照此答案的建议将大型文件移出目录。那里唯一的文件是一个 ~700 kB 的文本文件,但我把它移到了assets/,没有明显的变化。

  • 添加以下两个功能断言:

    <uses-feature android:name="android.hardware.faketouch" />
    <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
    

    我想也许我的手机没有声称支持通常的android.hardware.touchscreen功能,但同样,没有明显的变化。

When uploading the APK to the Play store, the only filter that it reports as active is the android.hardware.faketouchfeature.

将 APK 上传到 Play 商店时,它报告为活动的唯一过滤器是该android.hardware.faketouch功能。

The following is the output of aapt dump badging bin/NZSLDict-release.apk:

以下是输出aapt dump badging bin/NZSLDict-release.apk

package: name='com.hewgill.android.nzsldict' versionCode='3' versionName='1.0.2'
sdkVersion:'4'
targetSdkVersion:'4'
uses-feature:'android.hardware.faketouch'
uses-feature-not-required:'android.hardware.touchscreen'
application-label:'NZSL Dictionary'
application-icon-160:'res/drawable/icon.png'
application: label='NZSL Dictionary' icon='res/drawable/icon.png'
launchable-activity: name='com.hewgill.android.nzsldict.NZSLDictionary'  label='NZSL Dictionary' icon=''
main
other-activities
supports-screens: 'small' 'normal' 'large'
supports-any-density: 'true'
locales: '--_--'
densities: '160'

and for completeness, my manifest file:

为了完整起见,我的清单文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.hewgill.android.nzsldict"
      android:versionCode="3"
      android:versionName="1.0.2">
    <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="4" />
    <uses-feature android:name="android.hardware.faketouch" />
    <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
    <application android:label="@string/app_name"
        android:icon="@drawable/icon">
        <activity android:name="NZSLDictionary"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".WordActivity" />
        <activity android:name=".VideoActivity" />
        <activity android:name=".AboutActivity" />
    </application>
</manifest> 

In the "Device Availability" section of the Play store, I can see that all the HTC devices, including the Wildfire S, are supported except for "G1 (trout)" and "Touch Viva (opal)", whatever those are. Actually I see that both "Wildfire S (marvel)" and "Wildfire S A515c (marvelc)" are listed as supported, but my "Wildfire S A510b" is not specifically mentioned. Can this sort of sub-model identifier matter that much? I have been able to download several other apps from Google Play to my phone with no problems.

在 Play 商店的“设备可用性”部分,我可以看到除“G1(鳟鱼)”和“Touch Viva(蛋白石)”之外的所有 HTC 设备(包括 Wildfire S)都受支持。实际上我看到“Wildfire S (marvel)”和“Wildfire S A515c (marvelc)”都被列为支持,但我的“Wildfire S A510b”没有特别提及。这种子模型标识符有那么重要吗?我已经能够从 Google Play 将其他几个应用程序下载到我的手机上,没有任何问题。

The only thing I haven'tdone at this point is wait 4-6 hours after uploading the latest version (as in this comment) to see whether it still says it's incompatible with my phone. However, the Play store page currently shows 1.0.2 which is the latest I have uploaded.

目前我唯一没有做的就是在上传最新版本后等待 4-6 小时(如本评论中所示),看看它是否仍然说它与我的手机不兼容。但是,Play 商店页面当前显示的是 1.0.2,这是我上传的最新版本。

采纳答案by Greg Hewgill

The answer appears to be solely related to application size. I created a simple "hello world" app with nothing special in the manifest file, uploaded it to the Play store, and it was reported as compatible with my device.

答案似乎仅与应用程序大小有关。我创建了一个简单的“hello world”应用程序,清单文件中没有什么特别之处,将其上传到 Play 商店,并报告它与我的设备兼容。

I changed nothing in this app except for adding more content into the res/drawabledirectory. When the .apksize reached about 32 MB, the Play store started reporting that my app was incompatible with my phone.

除了在res/drawable目录中添加更多内容之外,我在这个应用程序中没有做任何改变。当.apk大小达到大约 32 MB 时,Play 商店开始报告我的应用程序与我的手机不兼容。

I will attempt to contact Google developer support and ask for clarification on the reason for this limit.

我将尝试联系 Google 开发人员支持并要求澄清此限制的原因。

UPDATE: Here is Google developer support response to this:

更新:这是 Google 开发人员支持对此的回应:

Thank you for your note. Currently the maximum file size limit for an app upload to Google Play is approximately 50 MB.

However, some devices may have smaller than 50 MB cache partition making the app unavailable for users to download. For example, some of HTC Wildfire devices are known for having 35-40 MB cache partitions. If Google Play is able to identify such device that doesn't have cache large enough to store the app, it may filter it from appearing for the user.

谢谢你的注意。目前,将应用上传到 Google Play 的最大文件大小限制约为 50 MB。

但是,某些设备的缓存分区可能小于 50 MB,从而导致用户无法下载该应用程序。例如,一些 HTC Wildfire 设备以具有 35-40 MB 的缓存分区而闻名。如果 Google Play 能够识别出没有足够大的缓存来存储应用程序的设备,它可能会过滤掉它,使其不向用户显示。

I ended up solving my problem by converting all the PNG files to JPG, with a small loss of quality. The .apkfile is now 28 MB, which is below whatever threshold Google Play is enforcing for my phone.

我最终通过将所有 PNG 文件转换为 JPG 来解决我的问题,但质量略有下降。该.apk文件现在为 28 MB,低于 Google Play 为我的手机强制执行的任何阈值。

I also removed all the <uses-feature>stuff, and now have just this:

我也删除了所有的<uses-feature>东西,现在只有这个:

<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />

回答by Joe

I ran into this as well - I did all of my development on a Lenovo IdeaTab A2107A-F and could run development builds on it, and even release signed APKs (installed with adb install) with no issues. Once it was published in Alpha test mode and available on Google Play I received the "incompatible with your device" error message.

我也遇到了这个问题 - 我在 Lenovo IdeaTab A2107A-F 上进行了所有开发,并且可以在其上运行开发构建,甚至可以毫无问题地发布已签名的 APK(安装了adb install)。在 Alpha 测试模式下发布并在 Google Play 上可用后,我收到了“与您的设备不兼容”的错误消息。

It turns out I had placed in my AndroidManifest.xmlthe following from a tutorial:

事实证明,我已经AndroidManifest.xml从教程中放入了以下内容:

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.CAMERA" />

Well, the Lenovo IdeaTab A2107A-F doesn't have an autofocusing camera on it (which I learned from http://www.phonearena.com/phones/Lenovo-IdeaTab-A2107_id7611, under Cons: lacks autofocus camera). Regardless of whether I was using that feature, Google Play said no. Once that was removed I rebuilt my APK, uploaded it to Google Play, and sure enough my IdeaTab was now in the compatible devices list.

好吧,联想 IdeaTab A2107A-F 上没有自动对焦相机(这是我从http://www.phonearena.com/phones/Lenovo-IdeaTab-A2107_id7611 中了解到的,缺点是:缺少自动对焦相机)。无论我是否使用该功能,Google Play 都拒绝了。删除后,我重建了我的 APK,将其上传到 Google Play,果然我的 IdeaTab 现在在兼容设备列表中。

So, double-check every <uses-feature>and if you've been doing some copy-paste from the web check again. Odds are you requested some feature you aren't even using.

因此,请仔细检查每一次<uses-feature>,如果您一直在从网上复制粘贴,请再次检查。很可能您请求了一些您甚至没有使用的功能。

回答by Ali Derbane

I have experienced this problem too while developing an application for a customer that wanted to have videos offline available from their application. I have written a blogpost about why the app I worked on for months wouldn't show up in the play store for my device (post can be found here). I found the same as @Greg Hewgill found: Cache partition limitations on some devices.

我在为希望从其应用程序中离线播放视频的客户开发应用程序时也遇到过这个问题。我写了一篇博文,说明为什么我工作了几个月的应用程序不会出现在我设备的 Play 商店中(可以在此处找到帖子)。我发现与@Greg Hewgill 发现的相同:某些设备上的缓存分区限制

The journey didn't stop for me there. The customer wanted to have these videos in the application and didn't want the quality of the video to be decreased. After some research I figured out that using expansion fileswas the perfect solution to our problem.

我的旅程并没有就此停止。客户希望在应用程序中包含这些视频,并且不希望视频质量下降。经过一番研究,我发现使用扩展文件是我们问题的完美解决方案。

To share my knowledge with the Android community I held a talk at droidconNL 2012about expansion files. I created a presentation and sample code to illustrate how easy it can be to start using expansion files. For any of you out there wanting to use expansion files to solve this problem feel free to check out the post containing the presentation and the sample code

为了与 Android 社​​区分享我的知识,我在droidconNL 2012 上举办了一场关于扩展文件的演讲。我创建了一个演示文稿和示例代码来说明开始使用扩展文件是多么容易。对于任何想要使用扩展文件来解决此问题的人,请随时查看包含演示文稿和示例代码的帖子

回答by Michael A.

You might want to try and set the supports-screens attribute:

您可能想尝试设置 support-screens 属性:

<supports-screens
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:xlargeScreens="true" >
</supports-screens>

The Wildfire has a small screen, and according to the documentation this attribute should default to "true" in all cases, but there are known issues with the supports-screens settings on different phones, so I would try this anyway.

Wildfire 有一个小屏幕,根据文档,该属性在所有情况下都应默认为“true”,但不同手机上的支持屏幕设置存在已知问题,因此无论如何我都会尝试这样做。

Also - as David suggests - always compile and target against the most current version of the Android API, unless you have strong reasons not to. Pretty much every SDK prior to 2.2 has some serious issue or weird behavior; the latter SDK's help to resolve or cover up a lot (although not all) of them. You can (and should) use the Lint tool to check that your app remains compatible with API 4 when preparing a release.

此外 - 正如大卫所建议的 - 始终针对最新版本的 Android API 进行编译和定位,除非您有充分的理由不这样做。几乎每个 2.2 之前的 SDK 都有一些严重的问题或奇怪的行为;后一个 SDK 有助于解决或掩盖很多(尽管不是全部)问题。在准备发布时,您可以(并且应该)使用 Lint 工具来检查您的应用程序是否与 API 4 保持兼容。

回答by Chintan Khetiya

Finlay, I have faced same issue in my application. I have developed Phone Gap app for android:minSdkVersion="7" & android:targetSdkVersion="18"which is recent version of android platform.

Finlay,我在我的申请中遇到了同样的问题。我开发了 Phone Gap 应用程序, android:minSdkVersion="7" & android:targetSdkVersion="18"它是最新版本的 android 平台。

I have found the issue using Google Docs

我使用Google Docs发现了这个问题

May be issue is that i have write some JS function which works on KEY-CODEto validate only Alphabets & Number but key board has different key code specially for computer keyboard & Mobile keyboard. So that was my issue.

可能的问题是我写了一些 JS 函数,KEY-CODE它只用于验证字母和数字,但键盘有不同的键码,专门用于计算机键盘和移动键盘。所以这是我的问题。

I am not sure whether my answer is correct or not and it might be possible that it could be smiler to above answer but i will try to list out some points which should be care while we are building the app.I hope you follow this to solve this kind of issue.

我不确定我的回答是否正确,上面的回答可能更有趣,但我会尝试列出一些在我们构建应用程序时应该注意的要点。我希望你按照这个来解决此类问题。

  • Use the android:minSdkVersion="?"as per your requirement & android:targetSdkVersion="?"should be latest in which your app will targeting. see more

  • Try to add only those permission which will be use in your application and remove all which are unnecessary .

  • Check out the supported screen by application

    <supports-screens 
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:resizeable="true"
    android:smallScreens="true"
    android:xlargeScreens="true"/>
    
  • May be you have implement some costume code or costume widget which couldn't able to run in some device or tab late so before writing the long code first try to write some beta code and test it whether your code will run in all device or not.

  • And I hope Google will publish a tool which can validate your code before the upload the app and also says that due to some specific reason we are not allow to run your app in some device so we can easily solve it.

  • android:minSdkVersion="?"根据您的要求使用,并且android:targetSdkVersion="?"应该是您的应用将针对的最新版本。查看更多

  • 尝试只添加那些将在您的应用程序中使用的权限,并删除所有不必要的权限。

  • 按应用程序查看支持的屏幕

    <supports-screens 
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:resizeable="true"
    android:smallScreens="true"
    android:xlargeScreens="true"/>
    
  • 可能您已经实现了一些无法在某些设备或标签中运行的服装代码或服装小部件,所以在编写长代码之前首先尝试编写一些测试版代码并测试您的代码是否可以在所有设备上运行.

  • 我希望谷歌发布一个工具,可以在上传应用程序之前验证您的代码,并表示由于某些特定原因,我们不允许在某些设备上运行您的应用程序,因此我们可以轻松解决它。

回答by davidcesarino

I have a couple of suggestions:

我有几个建议:

  1. First of all, you seem to be using API 4 as your target. AFAIK, it's good practice to always compile against the latest SDK and setup your android:minSdkVersionaccordingly.

  2. With that in mind, remember that android:requiredattribute was added in API 5:

  1. 首先,您似乎使用 API 4 作为目标。AFAIK,始终针对最新的 SDK 进行编译并进行相应的设置是一种很好的做法android:minSdkVersion

  2. 考虑到这一点,请记住该android:required属性是在 API 5 中添加的

The feature declaration can include an android:required=["true" | "false"]attribute (if you are compiling against API level 5 or higher), which lets you specify whether the application (...)

功能声明可以包含一个android:required=["true" | "false"]属性(如果您针对 API 级别 5 或更高级别进行编译),它允许您指定应用程序 (...)

Thus, I'd suggest that you compile against SDK 15, set targetSdkVersionto 15 as well, and provide that functionality.

因此,我建议您针对 SDK 15 进行编译,也设置targetSdkVersion为 15,并提供该功能。

It also shows here, on the Play site, as incompatiblewith any device that I have that is (coincidence?) Gingerbread(Galaxy Ace and Galaxy Y here). But it shows as compatiblewith my Galaxy Tab 10.1 (Honeycomb), Nexus S and Galaxy Nexus (both on ICS).

在 Play 网站上,它还显示与我拥有的任何设备(巧合?)姜饼(此处为 Galaxy Ace 和 Galaxy Y)不兼容。但它显示与我的 Galaxy Tab 10.1 ( Honeycomb)、Nexus S 和 Galaxy Nexus(均在ICS 上兼容

That also left me wondering, and this is a verywild guess, but since android.hardware.faketouchis API11+, why don't you try removing it just to see if it works? Or perhaps that's all related anyway, since you're trying to use features (faketouch) and the requiredattribute that are not available in API 4. And in this case you should compile against the latest API.

这也让我想知道,这是一个非常疯狂的猜测,但既然android.hardware.faketouch是 API11+,你为什么不尝试删除它,看看它是否有效?或者也许这都是相关的,因为您正在尝试使用API 4 中不可用的功能 ( faketouch) 和required属性。在这种情况下,您应该针对最新的 API 进行编译。

I would try that first, and remove the faketouchrequirement only as last resort (of course) --- since it works when developing, I'd say it's just a matter of the compiled app not recognizing the feature (due to the SDK requirements), thus leaving unexpected filtering issues on Play.

我会先尝试一下,并且faketouch仅作为最后的手段(当然)删除要求 --- 因为它在开发时有效,我会说这只是编译的应用程序无法识别该功能的问题(由于 SDK 要求) ,从而在 Play 上留下意外的过滤问题。

Sorry if this guess doesn't answer your question, but it's very difficult to diagnose those kind of problems and pinpoint the solution without actually testing. Or at least for me without all the proper knowledge of how Play really filters apps.

抱歉,如果这个猜测不能回答您的问题,但如果不进行实际测试,就很难诊断出这类问题并找出解决方案。或者至少对我来说没有关于 Play 如何真正过滤应用程序的所有正确知识。

Good luck.

祝你好运。

回答by OM PRAKASH SEERVI

Permissions that Imply Feature Requirements

暗示功能要求的权限

example, the android.hardware.bluetooth feature was added in Android 2.2 (API level 8), but the bluetooth API that it refers to was added in Android 2.0 (API level 5). Because of this, some apps were able to use the API before they had the ability to declare that they require the API via the system.

例如,android.hardware.bluetooth 特性是在 Android 2.2(API 级别 8)中添加的,但它所指的蓝牙 API 是在 Android 2.0(API 级别 5)中添加的。因此,一些应用程序在能够通过系统声明他们需要 API 之前就能够使用该 API。

To prevent those apps from being made available unintentionally, Google Play assumes that certain hardware-related permissions indicate that the underlying hardware features are required by default. For instance, applications that use Bluetooth must request the BLUETOOTH permission in a element — for legacy apps, Google Play assumes that the permission declaration means that the underlying android.hardware.bluetooth feature is required by the application and sets up filtering based on that feature.

为防止这些应用程序无意中可用,Google Play 假定某些与硬件相关的权限表明默认情况下需要底层硬件功能。例如,使用蓝牙的应用程序必须在元素中请求 BLUETOOTH 权限——对于旧版应用程序,Google Play 假定权限声明意味着应用程序需要底层 android.hardware.bluetooth 功能,并根据该功能设置过滤.

The table below lists permissions that imply feature requirements equivalent to those declared in elements. Note that declarations, including any declared android:required attribute, always take precedence over features implied by the permissions below.

下表列出了暗示功能要求与元素中声明的要求等效的权限。请注意,声明,包括任何声明的 android:required 属性,始终优先于以下权限隐含的功能。

For any of the permissions below, you can disable filtering based on the implied feature by explicitly declaring the implied feature explicitly, in a element, with an android:required="false" attribute. For example, to disable any filtering based on the CAMERA permission, you would add this declaration to the manifest file:

对于以下任何权限,您可以通过在元素中使用 android:required="false" 属性显式声明隐含功能来禁用基于隐含功能的过滤。例如,要禁用基于 CAMERA 权限的任何过滤,您可以将此声明添加到清单文件中:

<uses-feature android:name="android.hardware.camera" android:required="false" />


<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature android:name="android.hardware.telephony" android:required="false" />
<uses-feature android:name="android.hardware.wifi" android:required="false" />

http://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions

http://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions

回答by dvtoever

To give an extra solution to the above 'This app is incompatible with your...' problem, let me share my solution for a different problem cause. I tried installing an app on a low-end Samsung Galaxy Y (GT-S6350) device and got this error from the Play store. To test various AndroidManifest configurations, I created an account and followed the routine as described in https://stackoverflow.com/a/5449397/372838until my device showed up in the supported device list.

要为上述“此应用程序与您的...不兼容”问题提供额外的解决方案,让我分享我针对不同问题原因的解决方案。我尝试在低端 Samsung Galaxy Y (GT-S6350) 设备上安装应用程序,但从 Play 商店收到此错误。为了测试各种 AndroidManifest 配置,我创建了一个帐户并按照https://stackoverflow.com/a/5449397/372838 中描述的程序进行操作,直到我的设备出现在支持的设备列表中。

It turned out that a lot of devices become incompatible when you use the Camera permission:

事实证明,当您使用相机权限时,许多设备变得不兼容:

<uses-permission android:name="android.permission.CAMERA" />

<uses-permission android:name="android.permission.CAMERA" />

When I removed that specific permission, the application was available for 1180 devices instead of 870. Hope it will help someone

当我删除该特定权限时,该应用程序可用于 1180 台设备而不是 870 台。希望它会帮助某人

回答by keldar

Typical, found it right after posting this question in despair; the tool I was looking for was:

典型的,在绝望中发布这个问题后就找到了;我正在寻找的工具是:

$ aapt dump badging <my_apk.apk>

回答by Hong

Though there are already quite a few answers, I thought my answer might help some who have exactly the same problem as mine. In my case, the problem is caused by the following permissions added per the suggestion of an ad network:

虽然已经有很多答案,但我认为我的答案可能会帮助一些与我有完全相同问题的人。就我而言,问题是由根据广告网络的建议添加的以下权限引起的:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

The consequence of the above permissions is that the following features are added automatically:

上述权限的结果是自动添加了以下功能:

android.hardware.LOCATION
android.hardware.location.GPS
android.hardware.location.NETWORK

The reason is that "Google Play attempts to discover an application's implied feature requirements by examining other elements declared in the manifest file, specifically, elements." Two of my testing devices do not have the above features, so the app became incompatible with them. Removing those permissions solved the problem immediately.

原因是“Google Play 试图通过检查清单文件中声明的其他元素,特别是元素来发现应用程序的隐含功能要求。” 我的两个测试设备不具备上述功能,因此该应用程序与它们不兼容。删除这些权限立即解决了问题。