Nexus 7支持Android应用程序清单集成。

14

我有一个Android应用程序,其AndroidManifest.xml如下所示。上传到Google Play后,Nexus 7被列为不受支持的设备,我正在尝试找出原因。当然,Google Play不会告诉您是什么原因或清单的哪个权限或使用限制了该设备的支持。您有什么想法,下面的代码部分是导致Nexus 7被列为不支持的原因?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.xxxx.xxxx.applet"
    android:versionCode="x"
    android:versionName="x.x" >

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

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

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

    <application
        android:name="com.xxxx.xxxx.xxxx.xxxx"
        android:hardwareAccelerated="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:logo="@drawable/ic_launcher"
        android:theme="@android:style/Theme.Holo" >

        <activity
            android:name="MainActivity"
            android:configChanges="keyboardHidden|orientation"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:launchMode="singleTop" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

            <meta-data
                android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
                android:resource="@xml/device_list" />
        </activity>
</manifest>
1个回答

34
这个:

这个:

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

许多人感到惊讶,因为Nexus 7确实有前置摄像头,但似乎它在这个特定的权限上不起作用。


29
为了解决这个问题,请添加 <uses-feature android:name="android.hardware.camera" android:required="false"/>。请参考http://developer.android.com/guide/topics/manifest/uses-feature-element.html#permissions 和 http://android-developers.blogspot.com/2012/07/getting-your-app-ready-for-jelly-bean.html。 - CommonsWare
1
成功了!谢谢。此外,Google Play现在显示了40个更多可用设备。如果我可以在另一个线程中找到这个信息,我很抱歉,但感谢您的快速和正确的回复。 - user1607521
当我尝试在Nexus 7上运行https://github.com/pplante/zxing-android时,会显示对话框“抱歉,Android相机遇到问题,您可能需要重新启动设备!”但在手机上运行良好,尝试使用`<uses-feature android:name="android.hardware.camera" android:required="false"/>`也没有起作用! - LOG_TAG
1
@Subra:这与这个问题(与Play商店列表相关)无关,而且您已经向与崩溃相关的项目提交了一个问题:https://github.com/pplante/zxing-android/issues/2 - CommonsWare
@user1607521 我很好奇那些设备是哪些,但我猜Google Play可能也没有以方便的方式告诉你... - Nolan Amy
CommonsWare的解决方案对我有用。请注意,更改可能需要几个小时才能在Play商店中显示 - dm78

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接