我正在构建环境中通过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>
答案 0 :(得分:0)
尝试<uses-permission ... />
而不是<permission ... />
答案 1 :(得分:0)
您的清单中需要<uses-permission android:name="android.permission.NFC" />
,而是使用<permission>
标记获得您自己的权限。
答案 2 :(得分:0)
我的问题来自
<application ... **android:permission="android.permission.NFC">**
当我删除粗体区域时,我能够安装应用程序并运行已安装的应用程序。