Android test project is crashing with error “Test run failed: Instrumentation run failed due to 'Process crashed.'”

前端 未结 5 758
予麋鹿
予麋鹿 2021-02-12 10:41

My problem seems little different than here Test run failed: Instrumentation run failed due to 'Process crashed.' when testing multiple Android activity
I have follo

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-12 10:56

    In my case it was a StrictMode policy violation caused by AndroidJUnitRunner:

    D/StrictMode: StrictMode policy violation: android.os.strictmode.UntaggedSocketViolation: [...]
    W/System.err: StrictMode VmPolicy violation with POLICY_DEATH; shutting down.
    

    Disabling the check detectUntaggedSockets() when running an Espresso test fixed it for me. See this question for how to check for that.

提交回复
热议问题