Skip to content

Robolectric 4.2.1

Compare
Choose a tag to compare
@xian xian released this 15 Mar 23:57
· 4304 commits to master since this release

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!