Android Studio import existing unit tests “Unable to find instrumentation info”

前端 未结 15 1829
故里飘歌
故里飘歌 2021-02-01 12:17

So I\'m trying our Android Studio and testing a project that worked in eclipse. I got everything compiling and the application will launch just fine, but I can\'t get my unit te

15条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-01 12:49

    In my case the Run/Debug Configurations were wrong.

    One Solution:

    1. Go to Run/Debug Configurations

      Run -> Edit Configurations...

    2. Setup a Android-Test for your test class

    3. Select your Android test configuration on the left side
      or create a new one with the plus icon and name it e.g. ClassNameTest

    4. Select the module containing your test class. In the simplest case the test class is in your app module so select app.

    5. Select on the next row your test configuration. I use:

      • Class: to run all tests of one class.
    6. Choice your test class

    7. Finally configure your target device and select ok.

提交回复
热议问题