Skip to content

Releases: robolectric/robolectric

Robolectric 4.12.1

02 Apr 18:39
Compare
Choose a tag to compare

Robolectric 4.12.1 is a minor release that addressed two issues:

  1. Fixed a NoClassDefFoundError when invoking ShadowLog APIs outside of a Robolectric environment. See #8957 for details.
  2. Reduced the amount of spurious log noise that may be generated when attempting to delete temp directories in Windows. See android/nowinandroid#1242 for details.

Full Changelog: robolectric-4.12...robolectric-4.12.1

Robolectric 4.12

29 Mar 23:48
Compare
Choose a tag to compare

Robolectric 4.12 adds support for the native runtime (native SQLite and graphics modes) on Windows x86_64. It also contains a large number of bug fixes and performance improvements.

Note Robolectric 4.12 uses an updated version of the preinstrumented jars (version i6), so if you have infrastructure that caches or customizes the location of the preinstrumented jars, they will need to be updated.

What's Changed

  • Calling AlwaysOnHotwordDetector constructor reflectively #8549
  • Bump com.squareup.okhttp3:okhttp-bom from 4.11.0 to 4.12.0 by @dependabot in #8548
  • Bump androidx.core:core from 1.10.1 to 1.12.0 by @dependabot in #8463
  • Fix warnings of AndroidSdk.groovy by @utzcoz in #8503
  • Introducing SensorEventBuilder to replace ShadowSensorManager.createSensorEvent() #8581
  • Fix LocaleManager.setApplicationLocales(LocaleList) in Android U+ #8583
  • ShadowDisplayManager: Allowing adding a display with a name. #8591
  • Bump kotlin from 1.9.10 to 1.9.20 by @dependabot in #8594
  • Bump io.gitlab.arturbosch.detekt:detekt-gradle-plugin from 1.23.1 to 1.23.3 by @dependabot in #8595
  • Bump com.googlecode.libphonenumber:libphonenumber from 8.13.23 to 8.13.24 by @dependabot in #8576
  • Apply Spotless for buildSrc and build script by @utzcoz in #8603
  • Bump api changes checking compatibility version to 4.11.1 by @utzcoz in #8606
  • Bump com.android.tools.build:gradle from 8.1.2 to 8.1.3 by @dependabot in #8609
  • Bump com.ibm.icu:icu4j from 73.2 to 74.1 by @dependabot in #8611
  • Update ShadowNativeSQLiteConnection.nativeOpen to not ignore parameters #8612
  • Set the calling activity in ActivityScenario when run in Robolectric. #8613
  • Remove duplicated code in ShadowPackageManager.java by @realdadfish in #8614
  • Improve the fidelity of legacy SQLite error messages by @hoisie in #8615
  • Do not use isFileEncryptedNativeOrEmulated() on Android 14 and later by @ebiggers in #8616
  • Ignore nativeruntime-dist-compat from Dependabot by @utzcoz in #8617
  • Bump com.android.tools.build:gradle from 8.1.3 to 8.1.4 by @dependabot in #8618
  • Bump androidx-fragment from 1.2.0 to 1.6.2 by @dependabot in #8593
  • Bump org.bouncycastle:bcprov-jdk18on from 1.76 to 1.77 by @dependabot in #8619
  • Switch to use gradle/gradle-build-action@v2.9.0 by @utzcoz in #8621
  • Bump org.jetbrains:annotations from 24.0.1 to 24.1.0 by @dependabot in #8620
  • Update one GMD config from SDK 33 to 34 by @utzcoz in #8622
  • Ignore androidx annotation auto-update from Dependabot by @utzcoz in #8624
  • Bump com.googlecode.libphonenumber:libphonenumber from 8.13.24 to 8.13.25 by @dependabot in #8625
  • Bump androidx.window:window from 1.1.0 to 1.2.0 by @dependabot in #8626
  • Don't use isUserKeyUnlocked() after Android 14 by @ebiggers in #8635
  • Remove JDK requirements statement in README.md by @utzcoz in #8636
  • Enable CodeQL on GitHub Actions by @utzcoz in #8607
  • Use specific version of gradle/gradle-build-action for codeql.yml by @utzcoz in #8638
  • Bump kotlin from 1.9.20 to 1.9.21 by @dependabot in #8644
  • Bump gradle/gradle-build-action from 2.9.0 to 2.10.0 by @dependabot in #8647
  • Bump actions/checkout from 3 to 4 by @dependabot in #8646
  • Add ShadowBuild support for missing supported ABI fields by @jselbo in #8640
  • Bump com.googlecode.libphonenumber:libphonenumber from 8.13.25 to 8.13.26 by @dependabot in #8645
  • Bump com.diffplug.spotless:spotless-plugin-gradle from 6.22.0 to 6.23.0 by @dependabot in #8642
  • Bump io.gitlab.arturbosch.detekt:detekt-gradle-plugin from 1.23.3 to 1.23.4 by @dependabot in #8643
  • Bump default minSdk to 19 of AndroidManifest by @utzcoz in #8648
  • Bump actions/setup-java from 3 to 4 by @dependabot in #8664
  • Bump com.android.tools.build:gradle from 8.1.4 to 8.2.0 by @dependabot in #8667
  • Remove unused CheckApiChangesPlugin plugin by @utzcoz in #8630
  • Extract room version to libs.version.toml by @utzcoz in #8674
  • Bump com.diffplug.spotless:spotless-plugin-gradle from 6.23.0 to 6.23.3 by @dependabot in #8665
  • Bump com.googlecode.libphonenumber:libphonenumber from 8.13.26 to 8.13.27 by @dependabot in #8676
  • Align the behavior of HttpsURLConnection.getDefaultHostnameVerifier in Conscrypt mode. #8677
  • Add "yMMMd", "yMMMMEEEEd", and "yMMMM" date string formats to support correct date string formats. #8678
  • Add support for testing InboxStyle notifications. #8681
  • Create NetworkSpecifierFactory to allow creation of non-public NetworkSpecifier subtypes. #8685
  • ShadowInputManager.getInputDeviceIds() will now return results that corroborate the return values of .getInputDevices(). #8686
  • Fix RecordingCanvas.nFinishRecording for Q and R by @hoisie in #8690
  • Add code comment about the purpose of ShadowNativeBitmapFactory.decodeStream #8692
  • Ensure ContentResolver.applyBatch(...) return value is valid by @AntonButov in #8669
  • Bump com.ibm.icu:icu4j from 74.1 to 74.2 by @dependabot in #8695
  • Bump gradle/gradle-build-action from 2.10.0 to 2.11.0 by @dependabot in #8698
  • Make ClassInstrumentorTest more DRY #8699
  • Ensure that RNG is loaded when SystemFonts.getAvailableFonts is called in Q/R #8703
  • Bump github/codeql-action from 2 to 3 by @dependabot in #8697
  • Update native method instrumentation to include real native variants #8702
  • Update ShadowInCallService to not use reflection to set Phone in its constructor. #8705
  • Bump actions/upload-artifact from 3 to 4 by @dependabot in #8696
  • Revert "Bump actions/upload-artifact from 3 to 4" by @utzcoz in #8707
  • Add no-op implementation for ShadowNativeFontBuilder.nGetReleaseNativeAssetFunc #8708
  • Adding service management and updates writing function for ShadowBluetoothGatt and ShadowBluetoothGattServer #8709
  • Bump gradle/gradle-build-action from 2.11.0 to 2.11.1 by @dependabot in #8710
  • Bump kotlin from 1.9.21 to 1.9.22 by @dependabot in #8712
  • Use File.separator instead of a front slash in system font dir check #8714
  • Implement ShadowBluetoothA2dp codec switch related APIs #8715
  • Add additional CTS tests for BitmapFactory.decodeFileDescriptor #8718
  • Implement ShadowBluetoothA2dp optional codec related APIs #8723
  • Remove unused Exception from tests of ShadowConnectivityManager by @utzcoz in #8724
  • Add Roborazzi Integration Tests for Robolectric by @takahirom in #8719
  • Fix the Test Results Path for graphics tests by @takahirom in #8725
  • Disable Android T...
Read more

Robolectric 4.11.1

31 Oct 18:54
Compare
Choose a tag to compare

Robolectric 4.11.1 is a minor release that addressed three issues:

  1. Fixed a NoClassDefFoundError when using PixelCopy with compileSdkVersion < 34. See #8577 for details.
  2. Fixed LocaleManager.setApplicationLocales(LocaleList locales) in Android U. See #8580 for details.
  3. Fixed AttributeSetBuilder when referencing sparse resource table entries by name. See #8578 for details.

Full Changelog: robolectric-4.11...robolectric-4.11.1

Robolectric 4.11

28 Oct 22:58
Compare
Choose a tag to compare

Robolectric 4.11 adds support for Android SDK 34 (U). It also contains many bug fixes, performance improvements, and Shadow API enhancements. Robolectric 4.11 removes support for Android SDKs 18 and below. If you need to continue testing on Android SDK levels 18 and below, continue to use Robolectric 4.10.3.

Note that running tests on SDK 34 requires JDK 17.

What's Changed

  • Future proof ShadowViewGroupTest#hasFocus_shouldReturnTrueIfAnyChildHasFocus. #8034
  • Future proof ShadowCompanionDeviceManager for AssociationInfo change. #8035
  • Let example in README.md to use 4.10-alpha-1 by @utzcoz in #8056
  • Fix some Java Lint naming errors by @hoisie in #8058
  • Prep for OpenGL Matrix impl change in SDKs > T. #8060
  • Make ShadowJobScheduler thread safe #8064
  • Update issue templates by @utzcoz in #8067
  • Don't run some gradle tasks when md file changes only by @utzcoz in #8068
  • Remove unused Exception from AndroidTesetEnvironmentTest's method signature by @utzcoz in #8069
  • Bump com.diffplug.spotless:spotless-plugin-gradle from 6.16.0 to 6.17.0 by @dependabot in #8074
  • Bump com.googlecode.libphonenumber:libphonenumber from 8.13.7 to 8.13.8 by @dependabot in #8075
  • Import Robolectric Native Graphics tests by @hoisie in #7997
  • Remove SDK 33 Emulator tests by @utzcoz in #8077
  • Add tests for RNG in GitHub actions by @hoisie in #8080
  • Create separate sandboxes for different graphics modes #8082
  • Fix issue where Activity#isChangingConfigurations is incorrectly false during ActivityScenario#recreate in Robo tests. #8087
  • Bump asmVersion from 9.4 to 9.5 by @dependabot in #8088
  • Bump androidx.test.ext:junit from 1.1.4 to 1.1.5 by @dependabot in #8089
  • Bump com.google.auto:auto-common from 1.1.2 to 1.2.1 by @dependabot in #8090
  • Bump org.conscrypt:conscrypt-openjdk-uber from 2.4.0 to 2.5.2 by @dependabot in #8099
  • Bump com.googlecode.libphonenumber:libphonenumber from 8.13.8 to 8.13.9 by @dependabot in #8100
  • Bump org.ow2.asm:asm-tree from 9.4 to 9.5 by @dependabot in #8102
  • Add shadow getter/setter method for softApConfiguration. #8107
  • Add support for ARSC resource table compact encoding #8108
  • Fix gradle wranings for Kotlin configuration by @utzcoz in #8109
  • Fix comment for maven-dependency-resolver module by @utzcoz in #8111
  • Remove mockito-core from utils' test dependencies list by @utzcoz in #8112
  • Remove duplicated gradle plugin maven repository by @utzcoz in #8113
  • Fix AssetManagerTest on android U #8117
  • Migrate some Gradle's task definations to task.register by @utzcoz in #8114
  • Support partial AppComponentFactory in Robolectric by @utzcoz in #8004
  • Remove executable flag for some Java files by @utzcoz in #8121
  • Fix doc typo for ShadowWebview by @utzcoz in #8123
  • Update requestDismissKeyguard to turn screen on. #8125
  • Bump com.diffplug.spotless:spotless-plugin-gradle from 6.17.0 to 6.18.0 by @dependabot in #8127
  • Add test for ParameterizedRobolectricTestRunner with Kotlin by @utzcoz in #8122
  • Bump androidx.core:core from 1.9.0 to 1.10.0 by @dependabot in #8126
  • Added the PendingIntent.isTargetedToPackage() shadow implementation. #8141
  • Add namespace for android-library/application projects by @utzcoz in #8144
  • Remove force for dependency statements by @utzcoz in #8145
  • Remove unused SKIP_NATIVERUNTIME_BUILD for gradle_tasks_validation by @utzcoz in #8147
  • Bump io.mockk:mockk from 1.13.4 to 1.13.5 by @dependabot in #8151
  • Bump com.ibm.icu:icu4j from 72.1 to 73.1 by @dependabot in #8152
  • Bump org.bouncycastle:bcprov-jdk18on from 1.72 to 1.73 by @dependabot in #8153
  • Bump apiCompatVersion from 4.9.2 to 4.10 by @dependabot in #8150
  • Bump com.googlecode.libphonenumber:libphonenumber from 8.13.9 to 8.13.10 by @dependabot in #8154
  • Update ShadowTelephonyManager with Android 12 getCallstateForSubscription() #8161
  • Throw an error if a shadow has two methods annotated with @Resetter #8164
  • Make ShdadowVibrator compatible with SDK 28+ by @utzcoz in #8148
  • Bump com.squareup.okhttp3:okhttp-bom from 4.10.0 to 4.11.0 by @dependabot in #8167
  • Bump net.ltgt.gradle:gradle-errorprone-plugin from 3.0.1 to 3.1.0 by @dependabot in #8169
  • Add ShadowVpnManager to Robolectric. #8172
  • Add setDataEnabledForReason and isDataEnabledForReason for ShadowTelephonyManager #8177
  • Migrate useLegacy and JUnit assumeTrue/False to TruthJUnit assme by @utzcoz in #8149
  • Bump annotation to 1.3 by @utzcoz in #8182
  • Bump fragment version to 1.5.7 by @utzcoz in #8183
  • Bump com.googlecode.libphonenumber:libphonenumber from 8.13.10 to 8.13.11 by @dependabot in #8185
  • Fix another edge case in Jacoco instrumentation detection #8191
  • Switch conditional logic from LooperMode.PAUSED to LooperMode.LEGACY. #8195
  • Add new method setNotification() in ShadowJobService. This new method is newly introduced in Android U. #8196
  • Add shadow implementation for UserManager#removeUserWhenPossible() #8198
  • Enable version catalogs by @ganadist in #8199
  • Bump org.jacoco:org.jacoco.agent from 0.8.8 to 0.8.10 by @dependabot in #8202
  • Enable version catalogs by @ganadist in #8200
  • Add a Builder for CellInfoLte, as well as CellSignalStrengthLte/CellIdentityLte. #8207
  • Bump error-prone from 2.18.0 to 2.19.1 by @dependabot in #8210
  • Bump androidx.core:core from 1.10.0 to 1.10.1 by @dependabot in #8211
  • Only wake non-empty messageQueue on clock updates. #8216
  • Add implementation of TelephonyManager#getEmergencyNumberList, which will return a list of emergency number, which can bet set by TelephonyManager#setEmergencyNumberList static method #8217
  • Enable publish to snapshots by @hoisie in #8212
  • Android Versions in Robolectric. #8214
  • Bring snapshot usage documentation to README.md again by @utzcoz in #8229
  • Bump com.googlecode.libphonenumber:libphonenumber from 8.13.11 to 8.13.12 by @dependabot in #8230
  • Add ctesque test for reading material resources. #8233
  • Support sparse encoding in FindEntryByName. #8236
  • Add support for Build.setBoard in ShadowBuild #8237
  • Bump com.diffplug.spotless:spotless-plugin-gradle from 6.18.0 to 6.19.0 by @dependabot in #8246
  • Fix shadows framework gradle warnings by @utzcoz in #8244
  • Bump com.googlecode.libphonenumber:libphonenumber from 8.13.12 to 8.13.13 by @dependabot in https://github.com/robo...
Read more

Robolectric 4.11-beta-2

20 Oct 16:36
Compare
Choose a tag to compare
Pre-release

NOTE: Robolectric 4.11-beta-2 is an outdated preview release; please use 4.11 or later instead.

Robolectric 4.11-beta-1

18 Oct 21:20
Compare
Choose a tag to compare
Pre-release

NOTE: Robolectric 4.11-beta-1 is an outdated preview release; please use 4.11 or later instead.

Robolectric 4.10.3

17 May 20:31
Compare
Choose a tag to compare

Robolectric 4.10.3 is a minor release that addresses two issues:

  1. Fixes #8187, which was a performance regression that was introduced by 8780368. This performance regression only occurred if tests did not release transient HandlerThreads at the end of each test. It is still recommended to clean up any HandlerThreads to avoid leaking threads. Thanks @brettchabot for the fix (8311039).
  2. Adds additional logging to help diagnose #8205 ( f1e7b43), which is a SHA-512 mismatch when fetching android-all Jar files during runtime.

Full Changelog: robolectric-4.10.2...robolectric-4.10.3

Robolectric 4.10.2

05 May 21:35
Compare
Choose a tag to compare

Robolectric 4.10.2 is a minor release that fixes an issue related to re-instrumenting classes that have already been instrumented with Jacoco (1c22a48).

Full Changelog: robolectric-4.10.1...robolectric-4.10.2

Robolectric 4.10.1

03 May 00:00
Compare
Choose a tag to compare

Robolectric 4.10.1 is a minor release that fixes several issues:

  • Fixes issue #8163, which involve ICU extensions in SQLite (9551b04)
  • Fixes issue #8137, ShadowVibrator APIs on older SDK levels (5127cef), thanks @utzcoz
  • Fixes issue #8160, where an obscure exception would be thrown in resetters (866dacc).

Full Changelog: robolectric-4.10...robolectric-4.10.1

Robolectric 4.10

11 Apr 16:55
Compare
Choose a tag to compare

Robolectric 4.10 adds support for native Android graphics. It is currently disabled by default and can be enabled using @GraphicsMode(NATIVE). When native graphics is enabled, interactions with Android graphics classes use real native Android graphics code and are much higher fidelity.

Behavior changes

In Robolectric 4.10, ReflectionHelpers.setStaticField no longer removes the final keyword from static fields. This is because removing final using reflection stops working in JDK 18 due to https://openjdk.java.net/jeps/416. To remove final from static fields, consider using some instrumentation-based approach, such as mockito-inline.

What's Changed

  • Remove dead code that uses Plan based instrumentation (ClassHandler.Plan) #7610
  • Run SDK 33 tests on CI by @utzcoz in #7613
  • Bump maximum API for GMD to SDK 33 by @utzcoz in #7614
  • Remove use-sdk from androidx_test/sharedTest/AndroidManifest.xml by @utzcoz in #7615
  • [Warning] Eliminated AnnotateFormatMethod warnings by @hellosagar in #7353
  • Remove 0x prefix for string format log by @utzcoz in #7617
  • Bump compile/targetSdk to 33 by @utzcoz in #7616
  • Remove unused Exception for ShadowActivityTest by @utzcoz in #7618
  • Support Activity setShowWhenLocked() and setTurnScreenOn() by @utzcoz in #7438
  • Exclude kotlin-stdlib dependency from utils generated .pom by @utzcoz in #7607
  • Move dependencies of shadows/framework to gradle.properties by @utzcoz in #7627
  • Bump ASM to 9.3 by @utzcoz in #7626
  • Add the ability to deploy specific preinstrumented jars to maven by @hoisie in #7602
  • Combine exceptions for ReflectionHelpers#getDeclaredField by @utzcoz in #7634
  • Clean up ShadowAccountManager by @utzcoz in #7636
  • Migrate Gradle dependencies to dependencies.gradle by @utzcoz in #7635
  • Add alternative to Unsafe.defineAnonymousClass by @utzcoz in #7633
  • Support all authentication results for BiometricManager by @charlesng in #7427
  • Bump bcprov-jdk15on from 1.68 to 1.70 by @dependabot in #7638
  • Bump constraintlayout from 2.1.3 to 2.1.4 by @dependabot in #7640
  • Reuse bytecode of ClassWriter for ProxyMaker by @utzcoz in #7643
  • Migrate instance calling in ReflectionHelpers to lambda by @utzcoz in #7644
  • Bump compile-testing from 0.18 to 0.19 by @dependabot in #7645
  • Bump apiCompatVersion from 4.7 to 4.8.2 by @dependabot in #7647
  • Bump gson from 2.8.6 to 2.9.1 by @dependabot in #7646
  • Bump core from 1.5.0 to 1.9.0 by @dependabot in #7649
  • Clean up unused code for ShadowDisplayManagerTest by @utzcoz in #7662
  • Remove unused shadows ShadowCornerPathEffect and ShadowLinearGradient #7668
  • Bump apiCompatVersion from 4.8.2 to 4.9 by @dependabot in #7672
  • Add call to $$robo$init for Jacoco-instrumented constructors #7677
  • Respect ShadowProvider priority when populating the ShadowPicker map #7686
  • Properly parse & populate process information from the manifest. ServiceInfo.processName and ActivityInfo.processName will now correctly reflect the value of the process attribute from their respective manifest entry. #7690
  • Bump autoServiceVersion from 1.0-rc6 to 1.0.1 by @dependabot in #7674
  • Create an activity context for activities. #6481
  • Remove deprecated Utils#intArrayToList by @utzcoz in #7687
  • Fix configuration/resource handling in activity contexts #7692
  • Add Java source & target compatibility config for preinstrumented by @utzcoz in #7664
  • Update the ResourcesManager configuration when applying qualifiers #7697
  • Replace Config with Implementation #7710
  • Switch to ubuntu-20.04 for GitHub Actions by @utzcoz in #7716
  • Bump errorproneVersion from 2.9.0 to 2.16 by @dependabot in #7715
  • Bump Kotlin to 1.7.10 by @utzcoz in #7497
  • Upgrade androidx.test and androidx.fragment versions to latest. by @brettchabot in #7683
  • Bump kotlinVersion from 1.5.20 to 1.7.20 by @dependabot in #7694
  • Adding proxy settings to fetching artifacts by @sebastienrussell in #7713
  • Fix potential ClassCastException in RobolectricModel #7735
  • Ignore hprof file for Git by @utzcoz in #7739
  • Fix some issues in ShadowWallpaperManager #7740
  • Disable animation when running instrumentation tests by @utzcoz in #7741
  • Switch to use macos-12 for instrumentation-tests on CI by @utzcoz in #7743
  • Make CI Emulator's environment cleaner by @utzcoz in #7742
  • Bump auto-value from 1.9 to 1.10 by @dependabot in #7747
  • Add shadow implementation of MediaController#getExtras() #7749
  • Clean up language that appears to be cursing in Korean by @rexhoffman in #7752
  • Create Robolectric shadow for ResponderLocation. #7754
  • Make ShadowBitmap public APIs extendable #7756
  • Add getPackageUid (String packageName, PackageManager.PackageInfoFlags flags) to ShadowApplicationPackageManager. #7737
  • Update setLinkDownstreamBandwidthKbps Shadow method to shadow all APIs and have loose signatures #7758
  • Add new APIs to ShadowAlarmManager. #7759
  • Update snapshot version to 4.10 in README.md by @utzcoz in #7760
  • Fix android-9.0.0_r12 ResourceTypes.h link for ResTable by @utzcoz in #7762
  • Update to androidx.test 10.26.2022 RC release by @utzcoz in #7763
  • Make ShadowMatrix public APIs extendable #7768
  • Treat Pattern as the same if the pattern and flags are the same #7776
  • Remove unused looseSignatures from ShadowConextHubClient by @utzcoz in #7769
  • Update some access modifiers from private to protected to allow for overriding and subclass access #7781
  • Enclose The Robolectric.buildActivity() call with in try by @arinmodi in #7782
  • fix: Avoid referring to Android S's TelephonyCallback by @styluo in #7786
  • Bump AGP to 7.3.1 by @utzcoz in #7789
  • Enable Implements validation on Gradle again by @utzcoz in #7788
  • Add missed override for LocalActivityInvoker#startActivityForResult by @utzcoz in #7790
  • Migrate shadows/playservices to AndroidX by @jselbo in #7784
  • Only filter sdk when PREINSTRUMENTED_SDK_VERSIONS is not empty by @utzcoz in #7787
  • Use uninterruptibly acquire for ResTable's lock by @utzcoz in #7761
  • Change where addCallToRoboInit() inserts call to $$robo$init #7793
  • Deletes some ShadowNumberPicker functions that don't do anything, which allows DatePickerSpinner to use real values and the real class. #7797
  • Update to androidx.test 11.04.2022 stable release by @utzcoz in #7785
  • Add getActiveDataSubscriptionId to ShadowSubscriptionManage...
Read more