flutter.gradle: collect list of Android plugins from .flutter-plugins-dependencies#57907
Conversation
|
@blasten Did you already do something similar to this? |
|
/cc @cyanglaz Could you take a look at this? |
|
@blasten might have the most context and knowledge on this. |
|
LGTM! Thank you |
|
|
||
| Properties androidPlugins = new Properties() | ||
| allPlugins.each { name, path -> | ||
| if (doesSupportAndroidPlatform(path)) { |
There was a problem hiding this comment.
@igorakkerman this check should be preventing the issue that you are describing. I have created a new app and imported shared_preferences, I don't see this issue.
There was a problem hiding this comment.
@blasten Indeed, I could not reproduce the issue with the current shared_preferences package, sorry for that. But I do get the message with location and firebase_core.
I created a flutter project where the issue appears: https://github.com/igorakkerman/flutter_57907_example
> flutter clean
Deleting build... 319ms
Deleting .dart_tool... 7ms
Deleting Generated.xcconfig... 2ms
Deleting flutter_export_environment.sh... 1ms
> flutter pub get
Running "flutter pub get" in flutter_57907_example... 1,2s
> flutter run
Using hardware rendering with device Android SDK built for x86 64. If you get graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib\main.dart on Android SDK built for x86 64 in debug mode...
Plugin project :firebase_core_web not found. Please update settings.gradle.
Plugin project :location_web not found. Please update settings.gradle.
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 38,0s
√ Built build\app\outputs\flutter-apk\app-debug.apk.
There was a problem hiding this comment.
Feel free to reopen this PR again (It got rolled back). It's good to remove any reference to .flutter-plugins in the plugin.
…ncies (flutter#57907)" (flutter#58732) This reverts commit 253eb1c.
Description
Some packages include transitive dependencies to their web version, e.g.
shared_preferences -> shared_preferences_webPR #54407 introduced a change to the default
settings.gradlefile. The required plugins are now loaded throughapp_plugin_loader.gradle, which retrieves the list from.flutter-plugins-dependencies. Instead, the current logic influtter.gradlestill relies on.flutter-plugins, which lists transitive non-Android plugins.This leads to a warning in the build:
The pull request now uses the same logic as in
app_plugin_loader.gradleto retrieve the list of Android plugins.Note: The same logic now exists in 3 different locations and should be extracted to a separate file. The 3 locations are:
Related Issues
#55827
#57863
Tests
Please help me understand if / where to add tests for the changes. Thank you!
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.