Permission denied: injecting event from pid XXXX uid YYYY

1,004 views
Skip to first unread message

Miguel Aragues

unread,
Sep 25, 2015, 8:03:57 AM9/25/15
to Android Testing Support Library
Hi, I'm having issues with a test that fails ocassionally in Emulator and Genymotion (Nexus 4 running Android 4.4.2). I'm testing an Activity without layout that starts other Activities that contain Fragments. 

This is the ViewAction 

//actions on other activities that return the control to the main activity, that then starts BodyActivity

rotateScreen();

onView(withId(R.id.body_save_button)).check(matches(isDisplayed())).perform(click());

the error message 

PerformException: Error performing 'single click' on view 'with id: com.jointfully.debug:id/body_save_button'.
...
Caused by: android.support.test.espresso.PerformException: Error performing 'click (after 3 attempts)' on view 'unknown'.

I can see the view, so it's definitely on the screen, but for some reason Espresso can't inject the event

This logcat excerpt is the part that I feel could shed some light on the issue

Reconfiguring input devices.  changes=0x00000004
Device reconfigured: id=0, name='qwerty2', size 768x1280, orientation 1, mode 1, display id 0
//I guess the lines above are triggered by the screen rotation
...
Lifecycle status change: com.xxx.ui.body.BodyActivity@5294dd88 in: RESUMED
//just after rotate screen completed
...
callback completes: com.xxx.espresso.async.robospice.RobospiceIdlingResource@528765d8
//Idling resource just finished
Screen frozen for +266ms due to Window{529877e0 u0 StatusBar}
Permission denied: injecting event from pid 13493 uid 10067
Injection of up event failed (corresponding down event: MotionEvent { action=ACTION_DOWN, id[0]=0, x[0]=383.5, y[0]=1103.5, toolType[0]=TOOL_TYPE_UNKNOWN, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=12903759, downTime=12903758, deviceId=0, source=0x1002 })
Injection of up event as part of the click failed. Send cancel event.
Permission denied: injecting event from pid 13493 uid 10067
Input event injection from pid 13493 failed.
Input event injection from pid 13493 failed.
Injection of cancel event failed (corresponding down event: MotionEvent { action=ACTION_DOWN, id[0]=0, x[0]=383.5, y[0]=1103.5, toolType[0]=TOOL_TYPE_UNKNOWN, buttonState=0, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=12903759, downTime=12903758, deviceId=0, source=0x1002 })
Dropping event because there is no touchable window at (383, 1103).
Permission denied: injecting event from pid 13493 uid 10067
Input event injection from pid 13493 failed.
Dropping event because there is no touchable window at (383, 1103).
Permission denied: injecting event from pid 13493 uid 10067
Input event injection from pid 13493 failed.
Dropping event because there is no touchable window at (383, 1103).
Permission denied: injecting event from pid 13493 uid 10067
Input event injection from pid 13493 failed.
Lifecycle status change: com.xxx.ui.notification_landing.ProxyPendingPrescriptionsActivity@5282f800 in: DESTROYED


Several similar tests run without issues, and this very test sometimes passes, others it doesn't, so I'm clueless here. Thanks!

Евгений Краснов

unread,
Oct 19, 2015, 2:08:12 AM10/19/15
to Android Testing Support Library
Hi there!

I faced with this issue "Injecting to another application requires INJECT_EVENTS permission" too when I try to swipe on viewpager. 
Miguel, did you find the fix?

пятница, 25 сентября 2015 г., 16:03:57 UTC+4 пользователь Miguel Aragues написал:
Reply all
Reply to author
Forward
0 new messages