android / codelab-android-dagger

Apache License 2.0
183 stars 157 forks source link

Application test crashes for security error #35

Open RonyBrosh opened 4 years ago

RonyBrosh commented 4 years ago

If you get this error: Caused by: androidx.test.espresso.InjectEventSecurityException: java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission

Then, In the ApplicationTest file: Replace: onView(withId(R.id.password)).perform(typeText("password"), closeSoftKeyboard()) with: onView(withId(R.id.password)).perform(replaceText("password"), closeSoftKeyboard())

(two places in the file)