应用请求的权限未在清单文件中声明

4

这是我在清单文件中的所有权限:

 <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />

这是我尝试安装apk时的界面:

enter image description here

你知道为什么它会要求这些东西吗?明明应用程序根本不需要,而且在清单中也没有提到。

Nexus 5 (Android 4.4.2)

编辑:完整的清单

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="some.name"
    android:versionCode="14"
    android:versionName="0.6.2" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="19" />

    <!--
    To filter out tablets and distribute only to handsets up to 7 inches, one cannot directly forbid tablets, but has to list all other
    supported compatible screens, see: http://developer.android.com/guide/practices/screens-distribution.html#FilteringHandsetApps
     -->
    <compatible-screens>
        <!-- all small size screens -->
        <screen android:screenSize="small" android:screenDensity="ldpi" />
        <screen android:screenSize="small" android:screenDensity="mdpi" />
        <screen android:screenSize="small" android:screenDensity="hdpi" />
        <screen android:screenSize="small" android:screenDensity="xhdpi" />
        <screen android:screenSize="small" android:screenDensity="213" />
        <screen android:screenSize="small" android:screenDensity="480" />
        <!-- all normal size screens -->
        <screen android:screenSize="normal" android:screenDensity="ldpi" />
        <screen android:screenSize="normal" android:screenDensity="mdpi" />
        <screen android:screenSize="normal" android:screenDensity="hdpi" />
        <screen android:screenSize="normal" android:screenDensity="xhdpi" />
        <screen android:screenSize="normal" android:screenDensity="213" />
        <screen android:screenSize="normal" android:screenDensity="480" />
        <screen android:screenSize="normal" android:screenDensity="640" />
        <!-- all large size screens -->
        <screen android:screenSize="large" android:screenDensity="ldpi" />
        <screen android:screenSize="large" android:screenDensity="mdpi" />
        <screen android:screenSize="large" android:screenDensity="hdpi" />
        <screen android:screenSize="large" android:screenDensity="xhdpi" />
        <screen android:screenSize="large" android:screenDensity="213" />
        <screen android:screenSize="large" android:screenDensity="480" />
        <screen android:screenSize="large" android:screenDensity="640" />
    </compatible-screens>

    <!-- access backend -->
    <uses-permission android:name="android.permission.INTERNET" />

    <!-- allow to cache images on SD card -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <!-- TODO remove for live build - sends email info to crashes in hockey app -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />

    <!-- while video playback is running -->
    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <application
        android:name="some.name"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <activity
            android:name="some.name"
            android:screenOrientation="portrait"
            android:configChanges="keyboardHidden|orientation|screenSize"
            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="some.name"
            android:label="@string/app_name"
            android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:configChanges="keyboardHidden|orientation|screenSize" />

        <activity
            android:name="some.name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
            android:label="@string/app_name"
            android:windowSoftInputMode="stateAlwaysHidden|adjustPan" />

        <activity
            android:name="some.name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
            android:label="@string/app_name"
            android:windowSoftInputMode="stateAlwaysHidden|adjustPan" />

        <activity
            android:name="some.name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
            android:label="@string/app_name"
            android:windowSoftInputMode="stateAlwaysHidden|adjustPan" />

    </application>

</manifest>

3
也许您的一些库需要这些权限。 - Blaz
你的应用程序中是否已经添加了Google地图、相机和短信功能? - GrIsHu
请问您能否发布您的整个清单(manifest)吗? - apmartin1991
@blazsolar - 很好的观点,很可能就是这样。 - Lukas Hanacek
1个回答

1
这是因为您使用了一些库或JAR文件,它们使用了调用或消息传递的这些特性。

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