After update the APK supports fewer devices than p

2019-04-26 14:48发布

I have a relative simple App that was already in the Play-Store of Google.

Now I've made an Update of this App. One Point of this Update was that I include the ZBar-Scanner. The Rest of the changes were minimal and shouldn't have any influence on my problem.

I just put the newest verison of my App in the Play-Store and I get following warning: "Warning: Active APKs support fewer devices than previously active APKs. Some users will not receive updates."

I've downloaded ZBarAndroidSDK-0.2.zip from sourceforge.net (http://sourceforge.net/projects/zbar/files/AndroidSDK/) and import it to my project as it is explained in the README-File.

I tested my App local on my HTC Wildfire S (->Version 2.3.5), on Samsung Galaxy 3 (GT-I5800 -> Version 2.2) and on my Galaxy Nexus (-> Version 4.2). There was never a Problem. Everything worked. I also tested the exported APK and had no Problems.

Now I add this APK to the Play-Store and updated my App and I get the warning for the tested devices. Neither my HTC Wildfire, nor my Samsung Galaxy 3 can update the new version.

Can anybody help me and explain me whats the Problem?

Thanks a lot!!!

EDIT:

My Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.myproject"
android:versionCode="5"
android:versionName="2.0" 
android:installLocation="preferExternal"
>

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="11"/>

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

<application
    android:uiOptions="splitActionBarWhenNarrow"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    >

    <!-- enable the search dialog to send searches to SearchableActivity throughout the application -->
    <meta-data
        android:name="android.app.default_searchable"
        android:value=".SearchableActivity" />

    <activity
        android:label="@string/app_name"
        android:name=".MainActivity" 
        android:screenOrientation="portrait"
        android:theme="@style/Theme.NoBackground">                                  

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

    </activity>

    <activity
        android:label="@string/app_name"
        android:screenOrientation="landscape"
        android:name=".zbar.ZBarScannerActivity">                            
    </activity>

</application>

And the Manifest of ZBar:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="net.sourceforge.zbar.android.CameraTest"
  android:versionCode="1"
  android:versionName="1.0">

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

<application android:label="@string/app_name" >
    <activity android:name="CameraTestActivity"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

2条回答
男人必须洒脱
2楼-- · 2019-04-26 15:27

I had this problem with my application (with Zbar scanner) on tablet Zenithink C93 (http://www.zenithink.com/Eproducts_C93.php). I needed create application compatible with Zenithink devices.

I published app in Play-Store of Google. When I tried install application on Zenithink C93 I got error: "This item is not compatible with your device"

My manifest had this line:

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

But it didn't help me.

Also I had this support-screens tag:

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

Strangely, but after a long search solution I completely removed support-screens tag and put android:required="false" for <uses-feature android:name="android.hardware.camera"/> application became compatible with Zenithink device.

Now my Manifest looks like this:

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

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

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

<application...

This is not a good solution, because application will be compatible with almost all devices, but maybe it will help someone.

查看更多
你好瞎i
3楼-- · 2019-04-26 15:28

First of all, any change in the devices used must be a result of the manifest. That is the only thing that the Android market (Google Play) uses to determine what devices an app can go on. As you showed, the one difference was that you had a requirement to autofocus. If you change this line to the following, it should work.

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

Essentially, this will allow you to use that feature, but not make it required. This should allow full compatibility with all previous devices. For more information, see this answer.

I should also note that I saw the camera wasn't required by your main app, but is required by zbar. This could also make a difference.

查看更多
登录 后发表回答