-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add some instructions for combining transitive dependencies in add-to-app using plugins #3926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…-app using plugins
|
This looks fine to me, but I'm waiting for reviews by the SWEs. |
| version. In this example, the host app requested v2.10.1 and the Flutter | ||
| module plugin requested v2.9.9. | ||
|
|
||
| By default, Gradle v5 will [resolve dependency version conflicts](https://docs.gradle.org/current/userguide/dependency_resolution.html#sub:resolution-strategy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gradle v6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about gradle v5+? Since not everyone's on 6 and 5 resolves it this way too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.gradle.org/current/userguide/dependency_resolution.html refers to v6, which is the current version/
blasten
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM + minor nit
| module plugin requested v2.9.9. | ||
|
|
||
| By default, Gradle v5 will [resolve dependency version conflicts](https://docs.gradle.org/current/userguide/dependency_resolution.html#sub:resolution-strategy) | ||
| by using the newest version of the library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by using the newest version of the library
It picks the first dependency that shows up in Graph while traversing. :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even they admit that this is bad. "With Maven, this could have unwanted impact on resolved versions.".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol is that right?
https://docs.gradle.org/current/userguide/dependency_resolution.html says "Gradle will consider all requested versions, wherever they appear in the dependency graph. Out of these versions, it will select the highest one."
But it's so random I wouldn't be surprised if the implementation did that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess even the docs is confusing. It also says:
Apache Maven uses a nearest first strategy.
Maven will take the shortest path to a dependency and use that version. In case there are multiple paths of the same length, the first one wins.
sfshaza2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
|
||
| Some plugins require you to make some edits to the Android side of your project. | ||
|
|
||
| Taking the [firebase_crashlytics plugin](https://pub.dev/packages/firebase_crashlytics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Taking the firebase_crashlytics plugin as an example." is an awkward sentence, maybe "As an example, the firebase_crashlytics plugin integration instructionsl..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
took your version
| Some plugins require you to make some edits to the Android side of your project. | ||
|
|
||
| Taking the [firebase_crashlytics plugin](https://pub.dev/packages/firebase_crashlytics) | ||
| as an example. The plugin's integration instructions requires some manual edits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"instructions require manual edits"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| as an example. The plugin's integration instructions requires some manual edits | ||
| to your Android wrapper project's `build.gradle` file. | ||
|
|
||
| In the case of a Flutter module, which only has Dart files, perform those |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make these Gradle file edits on the outer, existing Android app rather than in your Flutter module, which only contains dart files.
| By default, Gradle v5 will [resolve dependency version conflicts](https://docs.gradle.org/current/userguide/dependency_resolution.html#sub:resolution-strategy) | ||
| by using the newest version of the library. | ||
|
|
||
| This is generally ok as long as there are no API or implementation breaking |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok->okay
| application already depends on the same Android library your Flutter module | ||
| does (transitively via a plugin). | ||
|
|
||
| For instance, your existing app's Gradle may already have: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sfshaza2 do you have a preference for "for example" vs "for instance"?
| For Gradle libraries that follow semantic versioning, making sure that your | ||
| existing app and your Flutter module plugin use the same major semantic version | ||
| will help you avoid compile or runtime errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Gradle libraries that follow semantic versioning, you can generally avoid compilation and runtime errors by using the same major semantic version in your existing app and Flutter module plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, took your version
The Android side of #7775.
https://flutter-website-staging-6f2ad.web.app/docs/development/add-to-app/android/plugin-setup