Skip to content

fix(bgp): don't force the plugin's AGP version onto apps - #475

Open
KisaneNeko wants to merge 4 commits into
callstack:mainfrom
KisaneNeko:fix/bgp-agp-compile-only
Open

KisaneNeko wants to merge 4 commits into
callstack:mainfrom
KisaneNeko:fix/bgp-agp-compile-only

Conversation

@KisaneNeko

@KisaneNeko KisaneNeko commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Fix for the Expo 57 Android build failing on main after #448.

The Gradle plugin declared AGP as implementation, so it ended up on the app's classpath and forced AGP 9.2.1 onto every app using it. That needs Gradle 9.4.1, and Expo 57 apps ship 9.3.1. Changes:

  • AGP is now compileOnly, so the app's own AGP is used
  • the plugin compiles against AGP 8.5.2 again. Built against 9.2.1 it fails on AGP 8 apps (Expo 57 uses 8.12) with NoClassDefFoundError. Tested locally: built against 8.5.2 it works on both AGP 8.12.0 and 9.2.1
  • TestKit tests get AGP on their plugin classpath, since it's no longer a runtime dependency

Also fixes two things from #467 that this PR's CI ran into:

  • renamed apps/AndroidApp/e2e/jest.config.expo56.cjs to expo58, which the rename missed (Expo 58 Android E2E couldn't find its config)
  • removed the leftover matrix from the Expo 57 build job, which built Expo 57 twice

Radoslaw Nowacki added 2 commits September 28, 2026 15:05
The plugin declared AGP as an `implementation` dependency, so it ended up
on the app's buildscript classpath and won version resolution. Since callstack#448
bumped it to AGP 9.2.1, every consumer gets AGP 9.2.1 and its minimum
Gradle 9.4.1, which breaks Expo SDK 57 apps (Gradle 9.3.1):
"Minimum supported Gradle version is 9.4.1. Current version is 9.3.1."

Compile against AGP but let the app provide it at runtime.

Also drop the leftover version matrix from the Expo 57 Android build job,
which ran the same Expo 57 build twice.
GradleRunner.withPluginClasspath() is built from the runtime classpath,
which no longer has AGP now that it is compileOnly, so
LegacyConsumerConfigurationTest could not apply com.android.library.
Radoslaw Nowacki added 2 commits September 29, 2026 13:38
callstack#467 renamed the Expo 56 app and AppleApp's jest.config.expo56.cjs to
expo58, but not AndroidApp's, so .detoxrc.expo58.cjs points at a file that
doesn't exist and Detox E2E (AndroidApp - Expo 58) fails with "Can't find
a root directory while resolving a config file path".
With AGP compileOnly the app provides AGP at runtime, but a plugin built
against AGP 9.2.1 references AGP 9 only classes and fails on AGP 8 apps:
Expo 57 (AGP 8.12) failed with NoClassDefFoundError
com/android/build/api/dsl/AndroidLibrarySourceSet. Built against 8.5.2
(the version before callstack#448) it applies on both AGP 8.12.0 and 9.2.1.

This branch has not been deployed

No deployments
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.

2 participants