简体   繁体   English

Android“权限拒绝”

[英]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. 在过去的三个月中,我一直在开发Android 2.2应用程序,但是上周决定尝试使用Android 2.1 SDK来构建应用程序。 The app 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: 该应用程序在模拟器中的2.2下运行良好,并且能够成功地将源构建为2.1项目,但是当我尝试在2.1模拟器中运行该应用程序时,出现以下运行时错误:

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 java.lang.SecurityException:权限拒绝:启动Intent {act = android.intent.action.MAIN cat = [android.intent.category.LAUNCHER] flg = 0x10000000 cmp = com.tampamobileapps.testapp / .LoginScreen}从null(pid = -1,uid = -1)需要null

The app is not that complicated and only makes HTTP POST and GET requests. 该应用程序并不复杂,仅发出HTTP POST和GET请求。 It also supports PayPal payments, but this API worked fine under 2.2. 它还支持PayPal付款,但是此API在2.2下可以正常工作。 I have googled this error message and have not found any solutions to get rid of the error. 我已经用Google搜索了此错误消息,但没有找到任何解决方法来摆脱该错误。

Any ideas? 有任何想法吗?


Edit: 编辑:

Here's the relevant parts of the Android manifest; 这是Android清单的相关部分; the LoginScreen currently does nothing of consequence. LoginScreen当前不执行任何操作。

<?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 . 您的清单中为.LoginScreen定义了重复的活动。 Try removing: 尝试删除:

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

You may need to use the android:exported="true" option. 您可能需要使用android:exported =“ true”选项。

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. 希望这对其他人有所帮助,因为我知道您可能已经解决了该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM