Skip to content

[BUG] v1.0.8 Android build fails: plugin pins AGP 8.7.3 which cannot be resolved from Google Maven #52

@ryaa

Description

@ryaa

Bug Report

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 8.0.0
  @capacitor/core: 8.0.0
  @capacitor/android: 8.0.0
  @capacitor/ios: 8.0.0

Installed Dependencies:

  @capacitor/cli: 7.2.0
  @capacitor/core: 7.2.0
  @capacitor/android: 7.2.0
  @capacitor/ios: 7.2.0

[success] iOS looking great! 👌
[success] Android looking great! 👌

Platform(s)

  • Android (Android Studio / Gradle sync)

Current Behavior

When using @capacitor/file-transfer@1.0.8, opening the Android project in Android Studio (or running a Gradle sync/build) fails while configuring the :capacitor-file-transfer module with errors like:

  • Could not find gradle-8.7.3.jar (com.android.tools.build:gradle:8.7.3)
  • plus a cascade of missing Android tooling/lint artifacts (e.g. 31.7.3)

See below

Image

Root cause: the plugin’s Android build.gradle includes a buildscript dependency that pins the Android Gradle Plugin (AGP) to 8.7.3:

buildscript {
  repositories {
    google()
    mavenCentral()
  }
  dependencies {
    classpath "com.android.tools.build:gradle:8.7.3"
  }
}

This forces Gradle to resolve AGP 8.7.3 (and matching tooling/lint artifacts like 31.7.3) from Google Maven, but those exact artifacts are not available at the expected coordinates, so dependency resolution fails.

Expected Behavior

@capacitor/file-transfer@1.0.8 should build / Gradle sync successfully in Android Studio.

Ideally, the plugin should not pin AGP inside the plugin module and instead inherit AGP from the consuming app/root project (common pattern for Capacitor/Android plugins).

Steps To Reproduce

  1. Install the plugin:
   npm i @capacitor/file-transfer@1.0.8
   npx cap sync android
  1. Open the Android project in Android Studio (or run ./gradlew assembleDebug)
  2. Observe Gradle sync/build failure for :capacitor-file-transfer with missing AGP/tooling artifacts.

Additional Context

  • This appears to be addressed in @capacitor/file-transfer v2.0.0+ (compare v1.0.8...v2.0.0), but v2.x targets the Capacitor 8 plugin/tooling baseline, while we are currently on Capacitor 7.x and cannot upgrade yet:
    v1.0.8...v2.0.0
Image
  • As a temporary workaround we can patch the plugin by removing the module-local AGP classpath so it uses the app’s AGP, but it would be great if v1.x and v2.x could be adjusted to avoid pinning an unresolvable AGP version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions