0

i have an empty android UI test for my MainActivity clas code below.

@RunWith(AndroidJUnit4.class) 

public class MainActivityTest {

@Rule public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>( MainActivity.class); @Test public void test() { } } 

its throwing an exception and I dont know why.

the log message is

"Test failed to run to completion. Reason: 'Instrumentation run failed due to 'android.system.ErrnoException''. Check device logcat for details Test running failed: Instrumentation run failed due to 'android.system.ErrnoException'"

I found this in the docs https://developer.android.com/reference/android/system/ErrnoException.html

but It doesn't really explain much. tried googling also but with no luck. found a few old answers on here but none using the testing support library and none of the questions had this particular type of exception. I was wondering can anyone help me out ? This may be a bit of an edge case. Thanks.

1 Answer 1

-1

Please check your AndroidManifest.xml; Make sure you have the defined permission below:

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

I received the same exception, and searched on Google. I finally added this permission to resolve the problem.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.