I had that problem even using
onView(withId(R.id.myEditText)).perform(closeSoftKeyboard());
What I found out, was that in my case, on some devices, Each Time I used
onView(withId(R.id.myEditText)).perform(TypeTextAction());
It was like the system stacked a new keyboard on top of another, so what solved my problem was to ALWAYS use closeSoftKeyboard() EVERY-TIME I used TypeTextAction Like this.
onView(withId(R.id.myEditText)).perform(typeTextAction(), closeSoftKeyboard());
So if I needed to edit a form it would be like:
onView(withId(R.id.myEditText1)).perform(typeTextAction(), closeSoftKeyboard());
onView(withId(R.id.myEditText2)).perform(typeTextAction(), closeSoftKeyboard());
onView(withId(R.id.myEditText3)).perform(typeTextAction(), closeSoftKeyboard());
onView(withId(R.id.myEditText4)).perform(typeTextAction(), closeSoftKeyboard());