java.lang.IllegalStateException: No instrumentation registered! Must run under a registering instrumentation

I think this is because of libraries androidx is conflicting with com.android.support.test. If you want to use jetpack, you must convert all of test library to androidx, if you don't want that way, just delete your androidx libraries and use all com.android.support.test. Check my latest answer in Android Instrumentation Testing: No instrumentation registered Error. Hope this help you.