Fixed
Status Update
Comments
nk...@google.com <nk...@google.com>
nk...@google.com <nk...@google.com> #2
Thanks for filing the issue.
This is a particularly hard device to come by - do you happen to have access to the device? If so could you provide us with the output of: adb shell dumpsys media.camera > info.txt
Thanks!
This is a particularly hard device to come by - do you happen to have access to the device? If so could you provide us with the output of: adb shell dumpsys media.camera > info.txt
Thanks!
Description
Version used:
What steps will reproduce the problem?
1. Call IntentsTestRule.launchActivity, and then finish activity
2. Call IntentsTestRule.launchActivity again in the same test case
3. Crash
How are you running your tests (via Android Studio, Gradle, adb, etc.)?
adb instrument
What is the expected output? What do you see instead?
The below error causes the Activity crash.
java.lang.IllegalStateException: #init was called twice in a row. Make sure to call #release after every #init
at android.support.test.espresso.intent.Checks.checkState(Checks.java:75)
at android.support.test.espresso.intent.Intents.internalInit(Intents.java:252)
at android.support.test.espresso.intent.Intents.init(Intents.java:133)
at android.support.test.espresso.intent.rule.IntentsTestRule.afterActivityLaunched(IntentsTestRule.java:59)
at android.support.test.rule.ActivityTestRule.launchActivity(ActivityTestRule.java:308)
The problem is that afterActivityLaunched is invoked 2 times, but afterActivityFinished is not called when activity finishes but until tearDown.
I think the fix is to call afterActivityFinished when activity finishes.