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

前端 未结 15 2042
故里飘歌
故里飘歌 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:47

    I solved this problem by changing

    android.test.InstrumentationTestRunner 
    

    into

    com.android.test.runner.MultiDexTestRunner
    

    in EditConfigurations -> Specific Instrumentation Runner (optional) tab.

    Turns out, because my app is using MultiDex, I need to change test runner to MultiDexTestRunner as well.

    UPDATE:

    As @dan comment, InstrumentationTestRunner is deprecated use AndroidJUnitRunner instead.

提交回复
热议问题