0

我正在从我的构建环境中通过 ADB 安装一个应用程序。我正在部署到物理 Nexus 7。(部署到模拟器时,没有问题)

当我部署时,安装似乎成功,但是当初始意图丢失时,我收到权限错误。

[2012-12-02 23:24:04 - KillerAppRejji] ActivityManager: java.lang.SecurityException:
Permission Denial: starting Intent { act=android.intent.action.MAIN cat=
android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.killerapprejji/.SplashScreen }
from null (pid=6116, uid=2000) requires android.permission.NFC

编辑:更新 manifest.xml 并更改为

AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.killerapprejji"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="15" />
    <uses-feature android:name="android.hardware.NFC" 
              android:required="true"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.NFC"/>

<application
    android:icon="@drawable/ninjahead"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" android:allowClearUserData="true" android:logo="@drawable/ninjahead" android:persistent="true" android:permission="android.permission.NFC">
    <activity android:name=".MainActivity" android:label="@string/title_activity_main">
        <intent-filter>
          <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
          <data android:mimeType="application/com.killerapprejji.NfcHandle"/>
          <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>
    <activity android:name=".SplashScreen" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER"/>  
        </intent-filter>
    </activity>
    <activity android:name=".AttackActivity" android:theme="@style/AppTheme" android:label="@string/attack_button"></activity>
    <activity android:launchMode="standard" android:screenOrientation="portrait" android:label="@string/menu_settings" android:alwaysRetainTaskState="true" android:noHistory="false" android:description="@string/menu_settings" android:configChanges="keyboard" android:theme="@style/AppTheme" android:parentActivityName="@string/title_activity_main" android:icon="@drawable/ninjahead" android:name=".SetInfo"></activity>
    <activity android:name=".DefendActivity" android:label="@string/defend_button" android:theme="@style/AppTheme"></activity>
    <activity android:name="DisplayInteractions" android:theme="@style/AppTheme" android:label="@string/Stats" android:parentActivityName="@string/title_activity_main"></activity>
    <activity android:name="NfcHandle">
        <intent-filter >
            <action android:name="android.nfc.action.NDEF_DISCOVERED"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <data android:mimeType="application/com.killerapprejji.NfcHandle"/>
        </intent-filter>
    </activity>
</application>

</manifest>
4

3 回答 3

0

我的问题来自

<application ... **android:permission="android.permission.NFC">**

当我删除粗体区域时,我能够安装应用程序并运行已安装的应用程序。

于 2012-12-03T06:25:52.033 回答
0

尝试<uses-permission ... />而不是<permission ... />

于 2012-12-03T05:29:43.067 回答
0

您需要在您的清单中,而是对标签<uses-permission android:name="android.permission.NFC" />进行自己的许可。<permission>

于 2012-12-03T05:29:48.390 回答