Flutter: Plugins can't add dependencies on custom maven repositories

Created on 8 May 2017  路  3Comments  路  Source: flutter/flutter

Steps to Reproduce

Right now the image_picker plugin has a dependency on the Android Image Picker Android library, which lives on GitHub along with the helper library Glide. Pulling in these libraries requires using Jitpack, which is a package repository that proxies requests to GIt. The codelab currently has a step where developers enable Jitpack by adding the following to their build.gradle:

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }  // new
    }
}

It would be nice if the plugins could know that they depend on the Jitpack repo and add this dependency automatically. Relatedly on iOS, perhaps plugins could add dependencies on third-party Cocoapods spec repos as well.

The downside of fixing this limitation is that it would make it less predictable for the Flutter developer where all their code is coming from. So maybe this is "working as intended"? But if they're using plugins they're already depending on pub to make builds. It certainly would be nice if developers could get things done with plugins without having to make build.gradle edits.

Somewhat lower priority in that this could probably be fixed in a way that isn't a breaking API change.

/cc @mravn-google @mit-mit @jakobr-google @szakarias

tooling plugin

Most helpful comment

Generalizing this bug to cover specifying a dependency on any custom maven repository:
maven { url '<maven_repo_url>' }

Besides the original jitpack example, other similar cases include ZenDesk and fabric.io.

All 3 comments

Generalizing this bug to cover specifying a dependency on any custom maven repository:
maven { url '<maven_repo_url>' }

Besides the original jitpack example, other similar cases include ZenDesk and fabric.io.

FYI: This issue is causing https://github.com/flutter/plugins/pull/141 to be a breaking change (even though the plugin API is untouched, I am just adding new dependencies to the plugin).

cc @mravn-google

Was this page helpful?
0 / 5 - 0 ratings