Skip to content

Bump Glide compileSdkVersion to 37 and Robolectric to 4.16#5702

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_928612579
Open

Bump Glide compileSdkVersion to 37 and Robolectric to 4.16#5702
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_928612579

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jun 8, 2026

Copy link
Copy Markdown

Bump Glide compileSdkVersion to 37 and Robolectric to 4.16

Bumping compileSdkVersion to 37 is required to resolve issues with dependencies (such as androidx.core:core and core-ktx version 1.19.0) that require compilation against API 37 or later.

This SDK bump triggers compilation failures in Robolectric tests across multiple modules:
"error: cannot access FingerprintManager ... class file for android.hardware.fingerprint.FingerprintManager not found"

This happens because FingerprintManager was removed in newer Android SDKs, but Robolectric's Shadows class (even in newer versions like 4.16) still contains references to it. During compilation of any test using Shadows (even those not using fingerprint features), the Java compiler attempts to resolve all method signatures in the Shadows class to perform overload resolution, failing because FingerprintManager is missing from the classpath.

To resolve this cleanly without introducing stubs, this CL:

  1. Bumps Robolectric to 4.16 to ensure better compatibility with the new SDK.
  2. Introduces a CustomShadows helper class in :testutil that provides shadowOf overloads using Shadow.extract instead of referencing org.robolectric.Shadows. This avoids pulling in the missing FingerprintManager reference at compile time.
  3. Adds a Robolectric dependency to the :testutil module so it can host the CustomShadows helper.
  4. Refactors all tests across all modules (including :library:test, :third_party:gif_decoder, and :integration:sqljournaldiskcache) to use CustomShadows.shadowOf (or avoid Shadows entirely where redundant), allowing the entire project to compile cleanly against compileSdk 37 without needing any Android framework stubs.
  5. Fixes some existing Error Prone TestExceptionChecker warnings in RequestManagerRetrieverTest that were triggered during recompilation.

@copybara-service copybara-service Bot changed the title Bump Glide compileSdkVersion to 37 Bump Glide compileSdkVersion to 37 and Robolectric to 4.13 Jun 8, 2026
@copybara-service copybara-service Bot changed the title Bump Glide compileSdkVersion to 37 and Robolectric to 4.13 Bump Glide compileSdkVersion to 37 and Robolectric to 4.16 Jun 8, 2026
Bumping compileSdkVersion to 37 is required to resolve issues with dependencies (such as `androidx.core:core` and `core-ktx` version `1.19.0`) that require compilation against API 37 or later.

This SDK bump triggers compilation failures in Robolectric tests across multiple modules:
"error: cannot access FingerprintManager ... class file for android.hardware.fingerprint.FingerprintManager not found"

This happens because `FingerprintManager` was removed in newer Android SDKs, but Robolectric's `Shadows` class (even in newer versions like 4.16) still contains references to it. During compilation of any test using `Shadows` (even those not using fingerprint features), the Java compiler attempts to resolve all method signatures in the `Shadows` class to perform overload resolution, failing because `FingerprintManager` is missing from the classpath.

To resolve this cleanly without introducing stubs, this CL:
1. Bumps Robolectric to 4.16 to ensure better compatibility with the new SDK.
2. Introduces a `CustomShadows` helper class in `:testutil` that provides `shadowOf` overloads using `Shadow.extract` instead of referencing `org.robolectric.Shadows`. This avoids pulling in the missing `FingerprintManager` reference at compile time.
3. Adds a Robolectric dependency to the `:testutil` module so it can host the `CustomShadows` helper.
4. Refactors all tests across all modules (including `:library:test`, `:third_party:gif_decoder`, and `:integration:sqljournaldiskcache`) to use `CustomShadows.shadowOf` (or avoid `Shadows` entirely where redundant), allowing the entire project to compile cleanly against `compileSdk 37` without needing any Android framework stubs.
5. Fixes some existing Error Prone `TestExceptionChecker` warnings in `RequestManagerRetrieverTest` that were triggered during recompilation.

PiperOrigin-RevId: 928612579
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant