android java permissions denial manifest.xml

断了今生、忘了曾经 提交于 2019-12-25 03:42:49

问题


Hi i am trying to build my project but i am getting the folowing error

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

My manifest file is as following

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

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.ACCESS_CHECKIN_PROPERTIES" />


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

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:label="@string/app_name"
            android:name=".Scan_AppActivity"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >

        </activity>
        <activity
            android:name=".nearby_exhibits"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >

        </activity>
        <activity
            android:label="@string/app_name"
            android:name=".SegmentedRadioActivity"
            android:theme="@android:style/Theme.Light" >
        </activity>
        <activity
            android:label="@string/app_name"
            android:name=".ds_main_page"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >

        </activity>
        <activity
            android:name=".my_scan"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >

        </activity>
        <activity
            android:name=".help_menu"
            android:theme="@android:style/Theme.NoTitleBar" >

        </activity>
        <activity
            android:name=".choose_language"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >
                             <intent-filter >
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

        </activity>
        <activity
            android:name=".splash_screen"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >

        </activity>
        <activity
            android:name=".register_screen"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >

        </activity>
        <activity
            android:name=".login"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >
        </activity>
        <activity
            android:name=".attraction_more_info"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >

        </activity>
        <activity
            android:name="chosen_my_scan_attraction"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" >

        </activity>
    </application>

</manifest>

if i remove the intent-filter part and add this to my splash screen activity my app starts fine but having this start up code on any other activity throws the above error. Does anyne know why this is?


回答1:


Frequently, requires null in a SecurityException means that the component is not exported. That should not be a problem in your case -- an activity is automatically exported when it has an <intent-filter>. I would settle on which activity in your app will have the <intent-filter>, and do a full uninstall of the app from your device/emulator and then reinstall to see if this helps.

BTW, ordinary SDK applications cannot hold ACCESS_CHECKIN_PROPERTIES.



来源:https://stackoverflow.com/questions/8627618/android-java-permissions-denial-manifest-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!