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

前端 未结 15 1861
故里飘歌
故里飘歌 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条回答
  •  猫巷女王i
    2021-02-01 12:57

    In my case in same classes some test cases were picking correct test runner ( android.support.test.runner.AndroidJUnitRunner ) which was defined in build.gradle, and some test cases were picking up android.test.InstrumentationTestRunner, which was not defined at least in Manifest or build.gradle or edit configuration. Ideally it should have been resolved by Sync Project with Gralde option, though it didn't work.

    At last I found wrong test runner defined against a method in .idea/workspace.xml, I changed it manually, and issue got resolved.

    Generally we are not supposed to edit this Android Studio generated file, but for me it did worked as last option.

提交回复
热议问题