Play商店报告APK不是专为平板电脑设计的,所有权限设置为不需要

时间:2015-09-08 23:39:59

标签: android

我在这里看到的解决这个问题的每个解决方案都涉及写作" androidrequired =" false""在每次使用许可后,在平板电脑上可能无法使用。我为我的清单中的每一次使用许可做了这个(很多,我知道),但仍然得到了#34;你的APK应该只需要通常在平板电脑上提供的硬件功能"在Google Play发布商的控制台上,平板电脑仍然无法下载我的应用程序。造成这种情况的原因是什么?

的AndroidManifest.xml     

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.myapp.app"
    android:versionCode="21"
    android:versionName="1.01R" >

    <!-- My App requires Android APK Level 16 (4.1) or above -->
    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="24" />

    <!-- GCM connects to Internet Services. -->
    <uses-permission android:name="android.permission.INTERNET" android:required="false" />

    <!-- GCM requires a Google account. -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" android:required="false" />

    <!-- Keeps the processor from sleeping when a message is received. -->
    <uses-permission android:name="android.permission.WAKE_LOCK" android:required="false" />

    <!-- Creates a custom permission so only this app can receive its messages. -->
    <permission
        android:name="com.myapp.app.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.myapp.app.permission.C2D_MESSAGE" android:required="false" />

    <!-- This app has permission to register and receive data message. -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" android:required="false" />

    <!-- Network State Permissions to detect Internet status -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" android:required="false" />

    <!-- Core function permissions -->
    <uses-permission android:name="android.permission.CALL_PHONE" android:required="false" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" android:required="false" />
    <uses-permission android:name="android.permission.VIBRATE" android:required="false" />
    <uses-permission android:name="android.permission.CAMERA" android:required="false" />
    <uses-permission android:name="android.hardware.camera" android:required="false" />
    <uses-permission android:name="android.permission.READ_CONTACTS" android:required="false" />
    <uses-permission android:name="android.permission.READ_SMS" android:required="false"/>
    <uses-permission android:name="android.permission.READ_CALL_LOG" android:required="false" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:required="false" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:required="false" />
    <uses-permission android:name="android.permission.FLASHLIGHT" android:required="false" />
    <uses-permission android:name="android.permission.SEND_SMS" android:required="false" />
    <uses-permission android:name="android.permission.WRITE_SMS" android:required="false" />
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" android:required="false" />
    <uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" android:required="false" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" android:required="false"  />
    <uses-permission android:name="android.permission.RECORD_AUDIO" android:required="false" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:required="false" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" android:required="false" />

    <!-- Main activity. -->
    <application
        android:icon="@drawable/newlogo2"
        android:label="@string/app_name"
        android:allowBackup="false"

         >
         <!-- Google Play Services Library. -->
        <meta-data 
            android:name="com.google.android.gms.version" 
            android:value="@integer/google_play_services_version" />

        <!-- Register Activity -->
        <activity
            android:name="com.myapp.app.RegisterActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <!-- Main Activity -->
        <activity
            android:name="com.myapp.app.MainActivity"
            android:configChanges="orientation|keyboardHidden"
            android:label="@string/app_name" >
        </activity>



        <!-- Google Cloud Messaging Receiver -->
        <receiver
            android:name="com.google.android.gcm.GCMBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>

                <!-- Receives the actual messages. -->
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <!-- Receives the registration id. -->
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="com.myapp.app" />
            </intent-filter>
        </receiver>

        <!-- Device Administration Receiver -->
        <receiver
            android:name="com.myapp.app.DeviceAdmin"
            android:permission="android.permission.BIND_DEVICE_ADMIN">
            <meta-data android:name="android.app.device_admin"
                       android:resource="@xml/device_admin" />
            <intent-filter>
                <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
                <action android:name="android.app.action.ACTION_DEVICE_ADMIN_DISABLE_REQUESTED" />
                <action android:name="android.app.action.ACTION_DEVICE_ADMIN_DISABLED" />
            </intent-filter>           
        </receiver>

        <!-- GCM Heartbeat Alarm Receiver -->
        <receiver
            android:name="com.myapp.app.GCMHeartbeatAlarm"
            android:permission="com.google.android.c2dm.permission.SEND"
            android:process=":remote"> 
        </receiver>

        <!-- Receiver called on successful device reboot  -->
        <receiver android:name="com.myapp.app.BootReceiver"
                  android:enabled="true">
                <intent-filter>
                    <action android:name="android.intent.action.BOOT_COMPLETED"></action>
                </intent-filter>
        </receiver>


        <service android:name="com.myapp.app.GCMIntentService" />
        <service android:name="com.myapp.app.LocationService" />
        <service android:name="com.myapp.app.AudioPlayer" />
        <service android:name="com.myapp.app.SoundRecorder" />

    </application>

</manifest>

1 个答案:

答案 0 :(得分:1)

  

我在这里看到的解决这个问题的每个解决方案都涉及在每次使用许可后写“androidrequired =”false“”,这在平板电脑上可能无法使用

没有任何解决方案可以表明,there is no android:required attribute on <uses-permission>

  

但仍然在Google Play发布商的控制台上获得“你的APK应该只需要平板电脑上通常可用的硬件功能”,平板电脑仍然无法下载我的应用程序。造成这种情况的原因是什么?

您拥有的几个<uses-permission>元素(以及$DEITY,您确实拥有很多<uses-permission>元素......)意味着您需要某些硬件功能。例如,CALL_PHONE意味着您需要设备具有电话功能。大多数平板电脑都没有这个。

对于这些权限,如果您愿意在没有该硬件功能的情况下使用,则可以添加<uses-feature>个元素 - 可以具有android:required属性 - 来说明这些硬件功能不是必需的。

可以在the documentation中找到相关权限表以及相应的隐含硬件功能。

另外,请删除:

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

因为没有这样的许可。