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!
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.
I got the same error after updating JUnit4 from:
androidTestImplementation 'junit:junit:4.12
to
androidTestImplementation 'junit:junit:4.13
The error went away when I downgraded back to:
androidTestImplementation 'junit:junit:4.12
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With