How to test an Android Library Project

前端 未结 6 2069
一向
一向 2021-01-30 01:28

I am writing an Android Library Project basing on Android Bitmap class (call it AndroindLib) which contains only utility class (no activity). I tried to test it using Android JU

6条回答
  •  生来不讨喜
    2021-01-30 01:59

    Per the documentation:

    Testing a library module is the same as testing an app. The main difference is that the library and its dependencies are automatically included as dependencies of the test APK. This means that the test APK includes not only its own code, but also the library's AAR and all its dependencies. Because there is no separate "app under test," the androidTest task installs (and uninstalls) only the test APK. When merging multiple manifest files, Gradle follows the default priority order and merges the library's manifest into the test APK's main manifest.

提交回复
热议问题