launchFragmentInContainer unable to resolve Activity in Android : <p>While writing a simple test which uses <code>launchFragmentInContainer</code>, I get the following error message:</p>

<pre><code>java.lang.RuntimeException: Unable to resolve activity for: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.myapp.appname.debug/androidx.fragment.app.testing.FragmentScenario$EmptyFragmentActivity (has extras) }
</code></pre>

<p>The basic test class is:</p>

<pre><code>class OneFragmentTest {

    @Test
    fun testOneFragmentState_checkTitleText() {
        val args = Bundle().apply {
            putString("dummyKey", "dummyValue")
        }
        launchFragmentInContainer&lt;OneFragment&gt;(args)

        onView(withId(R.id.tv_title)).check(matches(withText("title here")))
    }
}
</code></pre>

<p>I have tried to update <code>AndroidManifest.xml</code> with the following:</p>

<pre class="lang-xml prettyprint-override"><code>&lt;instrumentation
        android:name="android.test.InstrumentationTestRunner"
        android:targetPackage="com.myapp.appname" /&gt;
</code></pre>

<p>but it seems that the tag <code>instrumentation</code> is valid but the values are written in red, so I assume something is wrong with the <code>targetPackage</code> and <code>name</code>.</p>

<p>How can I get rid of this error and run a simple test on OneFragment using <code>launchFragmentInContainer</code>? </p>
