OpenMRS
Android client: Unit tests cannot run because of a deprecated library
When running any unit test that extends ACUnitTestBase, it fails during initialization part. Error:
java.lang.IllegalStateException: Failed to transform class with name com.activeandroid.Cache. Reason: cannot find android.support.v4.util.LruCache
(Full error at https://issues.openmrs.org/browse/AC-635)
Steps to reproduce
- Clone the latest master branch version
- Run a unit test (e.g. LoginPresenterTest)
- Observe the initialization error like above
Expected Outcome
We can run a unit test without encountering this initialization problem.
References
- The latest supported LruCache : https://developer.android.com/reference/androidx/collection/LruCache , the current one is using the v4 support library
- ActiveAndroid: https://guides.codepath.com/android/ActiveAndroid-Guide
Task tags
Students who completed this task
Ishaanndas