Skip to content

[various] Remove Artifact Hub Gradle repository scaffolding - #13767

Open
gmackall wants to merge 1 commit into
flutter:mainfrom
gmackall:remove-artifact-hub
Open

gmackall wants to merge 1 commit into
flutter:mainfrom
gmackall:remove-artifact-hub

Conversation

@gmackall

Copy link
Copy Markdown
Member

Removes ARTIFACT_HUB_REPOSITORY repository configuration, com.google.cloud.artifactregistry.gradle-plugin plugin declarations, and the corresponding GradleValidator checks and tests now that ARTIFACT_HUB_REPOSITORY is being removed from flutter/recipes in https://flutter-review.googlesource.com/c/recipes/+/87660.

Summary of Changes

  • 45 */android/build.gradle.kts (44 under packages/, 1 under third_party/packages/flutter_svg): removed the ARTIFACT_HUB_REPOSITORY environment lookup, println("Using artifact hub"), maven { url = uri(artifactRepoUrl) } block, and #gradle-structure comment; preserved google() and mavenCentral().
  • 45 */android/settings.gradle.kts: removed id("com.google.cloud.artifactregistry.gradle-plugin") version "2.2.1" and the #gradle-structure comment.
  • .ci/legacy_project/all_packages/android/settings.gradle: removed the leftover #gradle-structure comment.
  • script/tool/lib/src/validators/gradle_validator.dart & script/tool/test/validate_command_gradle_test.dart: removed the Artifact Hub validator constants, checks, and tests while keeping Kotlin version and javac lint validations intact (and preserving explicit settings.gradle.kts validation coverage in the Kotlin version check tests).

Context

ARTIFACT_HUB_REPOSITORY was originally added in 2023 (flutter/flutter#120119) before Android Swarming bots had a persistent gradle named cache. The configured mirror has been the direct source of intermittent 401, 404 (JAR), and 429 failures in flutter/packages Android CI (see https://flutter-review.googlesource.com/c/recipes/+/87660 for the 6-month failure breakdown and in-repo android_build_all_packages comparison). Once https://flutter-review.googlesource.com/c/recipes/+/87660 lands, this configuration is dead code; removing it also drops the extra com.google.cloud.artifactregistry.gradle-plugin plugin dependency from every example app.

Part of flutter/flutter#193719
Related: flutter/flutter#120119

Pre-Review Checklist

Footnotes

  1. Example-only Android Gradle CI scaffolding removal + script/tool validator cleanup (no published package library code changes); updated script/tool unit tests (validate_command_gradle_test.dart). ↩ ↩2

Removes unused `ARTIFACT_HUB_REPOSITORY` repository configuration,
`com.google.cloud.artifactregistry.gradle-plugin` plugin declarations,
associated `#gradle-structure` documentation comments, and the
corresponding `GradleValidator` checks and unit tests now that
`ARTIFACT_HUB_REPOSITORY` is being removed from `flutter/recipes`
(https://flutter-review.googlesource.com/c/recipes/+/87660).

Part of flutter/flutter#193719
@gmackall

Copy link
Copy Markdown
Member Author

Adding override: no changelog needed: all package edits are strictly inside example/android/ Gradle files removing Flutter-CI-only ARTIFACT_HUB_REPOSITORY scaffolding that has no effect on published packages or package clients.

Note: this check only fired because _isExampleBuildFile in script/tool/lib/src/common/package_state_utils.dart checks for build.gradle and settings.gradle but was never updated for Kotlin DSL (build.gradle.kts / settings.gradle.kts) — opened #13769 to fix that separately.

@gmackall gmackall added the override: no changelog needed Override the check requiring CHANGELOG updates for most changes label Nov 23, 2026
@bparrishMines

Copy link
Copy Markdown
Contributor

@gmackall Is this also a fix for the 429 errors we are now seeing on android builds in CI:

* What went wrong:
Execution failed for task ':app:checkReleaseDuplicateClasses' (registered by plugin 'com.android.internal.application').
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
   > Could not resolve androidx.media3:media3-exoplayer:1.9.2.
     Required by:
         project ':app' > project :video_player_android
         project ':app' > project :video_player_android > androidx.media3:media3-exoplayer-rtsp:1.9.2
         project ':app' > project :video_player_android > androidx.media3:media3-exoplayer-smoothstreaming:1.9.2
      > Could not resolve androidx.media3:media3-exoplayer:1.9.2.
         > Could not get resource 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer/1.9.2/media3-exoplayer-1.9.2.pom'.
            > Could not GET 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer/1.9.2/media3-exoplayer-1.9.2.pom'. Received status code 429 from server: Too Many Requests
   > Could not resolve androidx.media3:media3-exoplayer-hls:1.9.2.
     Required by:
         project ':app' > project :video_player_android
      > Could not resolve androidx.media3:media3-exoplayer-hls:1.9.2.
         > Could not get resource 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer-hls/1.9.2/media3-exoplayer-hls-1.9.2.pom'.
            > Could not GET 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer-hls/1.9.2/media3-exoplayer-hls-1.9.2.pom'. Received status code 429 from server: Too Many Requests
   > Could not resolve androidx.media3:media3-exoplayer-dash:1.9.2.
     Required by:
         project ':app' > project :video_player_android
      > Could not resolve androidx.media3:media3-exoplayer-dash:1.9.2.
         > Could not get resource 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer-dash/1.9.2/media3-exoplayer-dash-1.9.2.pom'.
            > Could not GET 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer-dash/1.9.2/media3-exoplayer-dash-1.9.2.pom'. Received status code 429 from server: Too Many Requests
> There are 12 more failures with identical causes.

@gmackall

Copy link
Copy Markdown
Member Author

@gmackall Is this also a fix for the 429 errors we are now seeing on android builds in CI:

* What went wrong:
Execution failed for task ':app:checkReleaseDuplicateClasses' (registered by plugin 'com.android.internal.application').
> Could not resolve all files for configuration ':app:releaseRuntimeClasspath'.
   > Could not resolve androidx.media3:media3-exoplayer:1.9.2.
     Required by:
         project ':app' > project :video_player_android
         project ':app' > project :video_player_android > androidx.media3:media3-exoplayer-rtsp:1.9.2
         project ':app' > project :video_player_android > androidx.media3:media3-exoplayer-smoothstreaming:1.9.2
      > Could not resolve androidx.media3:media3-exoplayer:1.9.2.
         > Could not get resource 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer/1.9.2/media3-exoplayer-1.9.2.pom'.
            > Could not GET 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer/1.9.2/media3-exoplayer-1.9.2.pom'. Received status code 429 from server: Too Many Requests
   > Could not resolve androidx.media3:media3-exoplayer-hls:1.9.2.
     Required by:
         project ':app' > project :video_player_android
      > Could not resolve androidx.media3:media3-exoplayer-hls:1.9.2.
         > Could not get resource 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer-hls/1.9.2/media3-exoplayer-hls-1.9.2.pom'.
            > Could not GET 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer-hls/1.9.2/media3-exoplayer-hls-1.9.2.pom'. Received status code 429 from server: Too Many Requests
   > Could not resolve androidx.media3:media3-exoplayer-dash:1.9.2.
     Required by:
         project ':app' > project :video_player_android
      > Could not resolve androidx.media3:media3-exoplayer-dash:1.9.2.
         > Could not get resource 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer-dash/1.9.2/media3-exoplayer-dash-1.9.2.pom'.
            > Could not GET 'https://us-maven.pkg.dev/artifact-foundry-prod/maven-3p/androidx/media3/media3-exoplayer-dash/1.9.2/media3-exoplayer-dash-1.9.2.pom'. Received status code 429 from server: Too Many Requests
> There are 12 more failures with identical causes.

This is just cleanup after the actual fix, which was
https://flutter-review.googlesource.com/c/recipes/+/87660
and has merged (an hour ago). It should be fixed, the 429's are from the server that we are not relying on any more. New builds should work

@gmackall
gmackall marked this pull request as ready for review November 23, 2026 20:32

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the Artifact Hub repository configuration and the Google Cloud Artifact Registry Gradle plugin from all example Android projects across the repository. It also removes the Artifact Hub validation logic from the Gradle validator tool and deletes the corresponding unit tests. There are no review comments, so I have no feedback to provide.

@gmackall
gmackall requested review from a team and reidbaker and removed request for a team November 24, 2026 16:19
@reidbaker

Copy link
Copy Markdown
Member

One other thing artifact hub did was scan our dependencies for security issues and stop vending those binaries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants