-
Notifications
You must be signed in to change notification settings - Fork 28.5k
[SwiftPM] Plugin not found right after adding #162399
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
Comments
I wrote on #163272, but I believe this is why: This was written under the assumption the |
Ok, it's not exactly used, but it does determine whether some symlink step is created or not: flutter/packages/flutter_tools/lib/src/flutter_plugins.dart Lines 1132 to 1140 in 9ffdd3a
|
…ntent changes. (#163275) Closes #162399. Closes #163272. `refreshPluginsList` is commonly called in iOS/macOS apps, more times than you expect (and load bearing); #157391. With `--explicit-package-dependencies`, we no longer write (or compare) the output of `.flutter-plugins`. The iOS/macOS workflows required `pod install` output to be invalidated when plugins when change, but the logic that was being used to see if plugins changed _only_ worked for the `.flutter-plugins` file format. In the original code: ```txt # oldPluginsFileStringContent {"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"integration_test","path":"/Users/matanl/Developer/flutter/packages/integration_test/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"ios_objc_cocoapods_plugin","path":"/var/folders/qw/qw_3qd1x4kz5w975jhdq4k58007b7h/T/swift_package_manager_enabled.XrEWXS/ios_objc_cocoapods_plugin/","native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"integration_test","path":"/Users/matanl/Developer/flutter/packages/integration_test/","native_build":true,"dependencies":[],"dev_dependency":false}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"integration_test","dependencies":[]},{"name":"ios_objc_cocoapods_plugin","dependencies":[]}],"date_created":"2025-02-13 17:01:11.023097","version":"3.30.0-1.0.pre.163","swift_package_manager_enabled":{"ios":true,"macos":false}} # pluginsMap {ios: [{name: integration_test, path: /Users/matanl/Developer/flutter/packages/integration_test/, native_build: true, dependencies: [], dev_dependency: false}, {name: ios_objc_cocoapods_plugin, path: /var/folders/qw/qw_3qd1x4kz5w975jhdq4k58007b7h/T/swift_package_manager_enabled.XrEWXS/ios_objc_cocoapods_plugin/, native_build: true, dependencies: [], dev_dependency: false}], android: [{name: integration_test, path: /Users/matanl/Developer/flutter/packages/integration_test/, native_build: true, dependencies: [], dev_dependency: false}], macos: [], linux: [], windows: [], web: []} ``` As you can see, `pluginsChanged = oldPluginsFileStringContent.contains(pluginsMap.toString());` was _always_ `false`, but we never knew because we'd always just fall back to using the `.flutter-plugins` content comparison (which always worked). I added a test as well. This also appears to fix #162399. /cc @jmagman @jonahwilliams
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 |
Steps to reproduce
Using Flutter 3.27.1, Xcode 16.2, iOS Simulator 18.2:
Create a SwiftPM plugin:
Create a SwiftPM app:
Open project in Xcode
ios/Runner.xcworkspace
using XcodeModify
my_app/pubspec.yaml
to depend on the plugin:Start iOS simulator 18.2
Run the app:
Expected results
I expect plugin_a to be found. I suspect this is a caching issue that's cause by having the project open in Xcode while also running from the command line, but we should look into it more.
Actual results
Code sample
Code sample
[Paste your code here]
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]
Flutter Doctor output
Doctor output
[Paste your output here]
The text was updated successfully, but these errors were encountered: