Instrumentation run failed due to 'Process crashed.'

androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"
androidTestImplementation "androidx.test:runner:1.3.0"
androidTestImplementation "androidx.test:core:1.3.0"
androidTestImplementation "androidx.test.ext:junit:1.1.2"
androidTestImplementation "androidx.test:rules:1.3.0"

except for the androidx.test.runner.AndroidJunitRunner config, please also check the dependency. The above code is worked for me.


Found the solution by myself. I updated to AndroidX, therefor I needed also to update my build.gradle file from:

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

to

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

I got the error:

Test running failed: Instrumentation run failed due to 'Process crashed.'

In my case, the android test console only showed the error above without any details.

But in the logcat, the full error was shown. In my case, I forgot to add the AdMob app_id in AndroidManifest.xml

So always remember to check the logcat for more error details!