Android Studio 0.3.2 debug Android 4.4 Pernission Problem

498 views
Skip to first unread message

Wang sen

unread,
Nov 5, 2013, 2:32:38 AM11/5/13
to adt...@googlegroups.com
I used a custom 4.4 rom for Nexus 4.
My IDE is the latest Android Studio 0.3.2. When I try to debug or run my app. the Permission Problem is appear :

Waiting for device.
Target device: lge-nexus_4-00548c2d4d166a9a
Uploading file
local path: D:\Practice\MyApplicationProject\MyApplication\build\apk\MyApplication-debug-unaligned.apk
remote path: /data/local/tmp/com.xt.test
Installing com.xt.test
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.xt.test"
pkg: /data/local/tmp/com.xt.test
Killed


Launching application: com.xt.test/com.xt.test.MainActivity.
DEVICE SHELL COMMAND: am start -n "com.xt.test/com.xt.test.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.xt.test/.MainActivity }
java.lang.SecurityException: Permission Denial: startActivity asks to run as user -2 but is calling from user 0; this requires android.permission.INTERACT_ACROSS_USERS_FULL
at android.os.Parcel.readException(Parcel.java:1461)
at android.os.Parcel.readException(Parcel.java:1415)
at android.app.ActivityManagerProxy.startActivityAsUser(ActivityManagerNative.java:2133)
at com.android.commands.am.Am.runStart(Am.java:680)
at com.android.commands.am.Am.onRun(Am.java:270)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method) 




I searched on Google for a few days, and I tried add Permission config in AndroidManifest.xml like this:

<?xml version="1.0" encoding="utf-8"?>
    package="com.xt.test"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.xt.test.MainActivity"
            android:label="@string/app_name"
            android:permission="android.permission.INTERACT_ACROSS_USERS_FULL">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>


I tried to find the IDE config to do. 


the problem is always here T-T.
Is anybody meet this problem ? thanks.

Dakota Weatherhead

unread,
Nov 15, 2013, 10:07:43 PM11/15/13
to adt...@googlegroups.com
I'm having problems with permissions after using a 4.4 ROM. Using a Fastboot tool to go back to stock and then flashing the 4.4 ROM seems to help. 4.4 definitely does not like the user to jump back and forth between 4.4 and older versions. I read that it was something to do with Google Play Services, but I tried replacing the app. It doesn't help. Going back to stock definitely seems to help though.
Reply all
Reply to author
Forward
0 new messages