robolectric v4.2.1 Release Notes

Release Date: 2019-03-15 // about 5 years ago
  • ๐Ÿš€ This release introduces a new extension mechanism for Robolectric, fixes a major performance regression in 4.x, and includes numerous SDK support improvements and bug fixes.

    ๐Ÿ› Bug Fixes

    • ๐Ÿ Robolectric 4.2.1 fixes a number of issues when running tests on Windows [issue 4670].
    • ๐Ÿ›  Applied fixes to activity lifecycle RoboMonitoringInstrumentation [4c7f968].

    Known Issues

    • ๐Ÿ‘€ Activities must now be explicitly declared in a manifest (as is the case for normal Android); however, Android Gradle Plugin doesn't currently merge a test manifest. See #4736 for more context and #4727 for a workaround.
    • โœ… Android Gradle Plugin 3.2.1 and 3.3 report the following warning, which may be safely ignored: WARNING: The option setting 'android.enableUnitTestBinaryResources=true' is experimental and unsupported.. Android Gradle Plugin 3.4 will resolve this issue.
    • ๐Ÿ Android Gradle Plugin 3.2.1 does not work on Windows; use 3.3+ instead [issue #3955].

    Compatibility

    • ๐Ÿ”Œ Android Studio/Android Gradle Plugin 3.3 or 3.4 Beta
    • โœ… Android SDK 28 (includes support for testing against SDKs from 16 on)

    ๐Ÿ‘‰ Use Robolectric:

    testCompile "org.robolectric:robolectric:4.2.1"
    

    Find more details here. Report issues here. Enjoy!