[go: nahoru, domu]

Skip to content
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

Example apps are broken if they use the old version of settings.gradle #98048

Closed
blasten opened this issue Feb 8, 2022 · 7 comments · Fixed by #137115
Closed

Example apps are broken if they use the old version of settings.gradle #98048

blasten opened this issue Feb 8, 2022 · 7 comments · Fixed by #137115
Labels
a: plugins Support for writing, building, and running plugin packages P2 Important issues not at the top of the work list platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@blasten
Copy link
blasten commented Feb 8, 2022

After #97823, some builds break if the app uses the older version of settings.gradle.

For example, webview_flutter_android:

 Where:
Script 'flutter/packages/flutter_tools/gradle/flutter.gradle' line: 509

* What went wrong:
A problem occurred configuring project ':path_provider'.
> Failed to notify project evaluation listener.
   > Could not find method implementation() for arguments [project ':path_provider_android'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
   > Could not find method implementation() for arguments [project ':path_provider_ios'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
   > Could not find method implementation() for arguments [project ':path_provider_linux'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
   > Could not find method implementation() for arguments [project ':path_provider_macos'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
   > Could not find method implementation() for arguments [project ':path_provider_windows'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

This can be fixed by updating settings.gradle to the latest version:
https://github.com/flutter/flutter/blob/master/packages/flutter_tools/templates/app_shared/android.tmpl/settings.gradle

cc @GaryQian for the migration tool
cc @stuartmorgan

@blasten blasten added platform-android Android applications specifically plugin labels Feb 8, 2022
@GaryQian
Copy link
Contributor
GaryQian commented Feb 8, 2022

Migration tool will be able to handle this case.

@GaryQian
Copy link
Contributor
GaryQian commented Feb 8, 2022

Is this important enough to revert #97823 for now? It seems that it is more common for apps to use legacy settings.gradle than use iOS only plugins

@blasten
Copy link
Author
blasten commented Feb 8, 2022

yes, let's revert it for now, and reland after the migration tool lands.

@stuartmorgan
Copy link
Contributor
stuartmorgan commented Feb 8, 2022

than use iOS only plugins

It's more of an edge case than that; it's using a plugin that doesn't support Android but has an android/ folder. (Most likely due to sloppy updating of a plugin that used to have a dummy Android implementation since that used to be required.)

@blasten blasten added P2 Important issues not at the top of the work list and removed P2 labels Feb 8, 2022
@stuartmorgan stuartmorgan added tool Affects the "flutter" command-line tool. See also t: labels. a: plugins Support for writing, building, and running plugin packages and removed plugin labels Mar 11, 2023
@gnprice
Copy link
Member
gnprice commented Apr 18, 2023

The revert #98050 was landed. Is there still an open task that this issue is tracking?

(I see that when the revert landed, the issue was lowered in priority but kept open: #98048 (comment) )

@stuartmorgan
Copy link
Contributor

It may have been intended to track getting to the point where we can reland that change, but since the original issue is still open I don't think we need it.

@github-actions
Copy link
github-actions bot commented May 2, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2023
auto-submit bot pushed a commit that referenced this issue Dec 21, 2023
Relands #97823

When the tool migrated to `.flutter-plugins-dependencies`, the Gradle plugin was never changed.
Until now, the plugin had the heuristic that a plugin with a `android/build.gradle` file supported the Android platform.

Also applies schema of `getPluginDependencies` to `getPluginList` which uses a `List` of Object instead of `Properties`.

Fixes #97729
Cause of the error: https://github.com/flutter/flutter/blob/5f105a6ca7a5ac7b8bc9b241f4c2d86f4188cf5c/packages/flutter_tools/gradle/flutter.gradle#L421C25-L421C25

Fixes #98048
The deprecated line `include ":$name"` in `settings.gradle` (pluginEach) in old projects causes the `project.rootProject.findProject` to also find the plugin "project", so it is not failing on the `afterEvaluate` method. But the plugin shouldn't be included in the first place as it fails with `Could not find method implementation() for arguments` error in special cases.

Related to #48918, see [_writeFlutterPluginsListLegacy](https://github.com/flutter/flutter/blob/27bc1cf61a5b54bf655062be63050123abb617e4/packages/flutter_tools/lib/src/flutter_plugins.dart#L248).

Co-authored-by: Emmanuel Garcia <egarciad@google.com>
CoderDake pushed a commit to CoderDake/flutter that referenced this issue Dec 28, 2023
Relands flutter#97823

When the tool migrated to `.flutter-plugins-dependencies`, the Gradle plugin was never changed.
Until now, the plugin had the heuristic that a plugin with a `android/build.gradle` file supported the Android platform.

Also applies schema of `getPluginDependencies` to `getPluginList` which uses a `List` of Object instead of `Properties`.

Fixes flutter#97729
Cause of the error: https://github.com/flutter/flutter/blob/5f105a6ca7a5ac7b8bc9b241f4c2d86f4188cf5c/packages/flutter_tools/gradle/flutter.gradle#L421C25-L421C25

Fixes flutter#98048
The deprecated line `include ":$name"` in `settings.gradle` (pluginEach) in old projects causes the `project.rootProject.findProject` to also find the plugin "project", so it is not failing on the `afterEvaluate` method. But the plugin shouldn't be included in the first place as it fails with `Could not find method implementation() for arguments` error in special cases.

Related to flutter#48918, see [_writeFlutterPluginsListLegacy](https://github.com/flutter/flutter/blob/27bc1cf61a5b54bf655062be63050123abb617e4/packages/flutter_tools/lib/src/flutter_plugins.dart#L248).

Co-authored-by: Emmanuel Garcia <egarciad@google.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: plugins Support for writing, building, and running plugin packages P2 Important issues not at the top of the work list platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants