开发者

Android "Permission Denial"

I have been working on an Android 2.2 app for the past three months, but decided this past week to try to build the app using Android 2.1 SDK. The app开发者_C百科 ran fine under 2.2 in the emulator, and I was able to build the source as a 2.1 project successfully, but when I try to run the app in the 2.1 emulator, I get the following runtime error:

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.tampamobileapps.testapp/.LoginScreen } from null (pid=-1, uid=-1) requires null

The app is not that complicated and only makes HTTP POST and GET requests. It also supports PayPal payments, but this API worked fine under 2.2. I have googled this error message and have not found any solutions to get rid of the error.

Any ideas?


Edit:

Here's the relevant parts of the Android manifest; the LoginScreen currently does nothing of consequence.

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

    <application android:icon="@drawable/icon" 
      android:debuggable="true"
      android:label="@string/app_name"
      android:name=".SharedApplicationContext">

        <activity android:name=".LoginScreen"
          android:label="@string/login_screen_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>                    
        <activity android:name=".LoginScreen"
          android:label="@string/app_name">
        </activity>
        <activity android:name=".MainMenu"
          android:label="@string/app_name">
        </activity>

    </application>

    <uses-sdk android:minSdkVersion="7" />
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>

</manifest> 


You have duplicate activities defined in your manifest for .LoginScreen. Try removing:

<activity android:name=".LoginScreen"
                  android:label="@string/app_name">
 </activity>


You may need to use the android:exported="true" option.

For instance, preference activities in live wallpapers need this set. Hope this helps someone else as I know you have probably already sorted the issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜