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

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

    It seams you have not good project structure.

    1. Open AndroidManifest.xml and check does it have

      
      

    If NO do next:

    1. Reorganize your directory structure to the following one: (this is the recomendation from official source)
            MyProject/
                  AndroidManifest.xml
                  res/
                      ... (resources for main application)
                  src/
                      ... (source code for main application) ...
                  tests/
                      AndroidManifest.xml
                      res/
                          ... (resources for tests)
                      src/
                          ... (source code for tests)
    
    1. You see that you need to have inner tests module.
      For creating it in Idea IDE do next File -> New Module -> Test Module. After creating you can see one new AndroidManifest.xml. And it has instrumentation declaration inside.

提交回复
热议问题