Skip to content

Expose a way to download and list Android dependencies #154165

Open

Description

@HosseinYousefi

We want a command like flutter build --config-only (or similar) to download Gradle dependencies and list the jar files. Preferably this should work even if the Flutter project is a plugin and not an application with a main function.

This is useful for jnigen where we want to generate Dart bindings for an application's gradle dependencies.

Similarly, downloading source jars and Javadocs are useful, here is a task that downloads the source artifacts. (Replacing SourcesArtifact with JavadocArtifact will do the same for Javadocs)

tasks.register("getSources") {
    doLast {
        val componentIds =
            configurations["releaseCompileClasspath"].incoming.resolutionResult.allDependencies.map { it.from.id }
        val result = dependencies.createArtifactResolutionQuery().forComponents(componentIds)
            .withArtifacts(JvmLibrary::class.java, SourcesArtifact::class.java).execute()
        val sourceArtifacts = mutableListOf<File>()
        result.resolvedComponents.forEach { component ->
            val sources = component.getArtifacts(SourcesArtifact::class.java)
            sources.forEach { artifact ->
                if (artifact is ResolvedArtifactResult) {
                    sourceArtifacts.add(artifact.file)
                }
            }
        }
        sourceArtifacts.forEach { println(it) }
    }
}

Context: dart-lang/native#628

@gmackall @reidbaker

Activity

  1. added
    in triagePresently being triaged by the triage team
    toolAffects the "flutter" command-line tool. See also t: labels.
    t: gradle"flutter build" and "flutter run" on Android
    a: buildBuilding flutter applications with the tool
    team-androidOwned by Android platform team
    and removed
    in triagePresently being triaged by the triage team
    on Aug 27, 2024
  2. added
    ⏳Bot is counting down the days until it unassigns the issue
    on Jan 15, 2026
  3. flutter-triage-bot commented on Jan 15, 2026

    @flutter-triage-bot

    This issue is assigned to @HosseinYousefi but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  4. flutter-triage-bot commented on Jan 15, 2026

    @flutter-triage-bot

    This issue was assigned to @HosseinYousefi but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  5. removed
    ⏳Bot is counting down the days until it unassigns the issue
    on Jan 15, 2026
  6. added
    P2Important issues not at the top of the work list
    triaged-androidTriaged by Android platform team
    on Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: buildBuilding flutter applications with the toolp: toolingAffects the flutter_plugin_tools packaget: gradle"flutter build" and "flutter run" on Androidteam-androidOwned by Android platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions