Unable to resolve activity for: Intent

后端 未结 7 1763
伪装坚强ぢ
伪装坚强ぢ 2021-01-17 08:21

I am having a problem in running Android unit test. I got this error when I tried to run a simple test.

Here\'s the log:

Blockquote java.la

相关标签:
7条回答
  • 2021-01-17 09:17

    In my case the problem was that TestFragmentActivity, meaning the Activity used in our test

    extends ActivityInstrumentationTestCase2<TestFragmentActivity>
    

    must be available in the package defined in Manifest.xml as targetPackage:

    <instrumentation
        android:name="android.test.InstrumentationTestRunner"
        android:targetPackage="de.my.androidhd" />
    

    My solution was to move TestFragmentActivity into tested application package.

    0 讨论(0)
提交回复
热议问题