Adds google_mobile_ads support for Swift Package Manager#1395
Conversation
| <string>arm64</string> | ||
| </array> | ||
| <key>MinimumOSVersion</key> | ||
| <string>13.0</string> |
There was a problem hiding this comment.
This is an auto-migration from running with a recent version of Flutter; I can revert if you prefer, as it's unrelated, but it will be re-deleted on every run.
There was a problem hiding this comment.
This new file is the result of following the instructions for manually adding SwiftPM support to the example app.
| **/Flutter/flutter_assets/ | ||
| ServiceDefinitions.json | ||
| xcuserdata/ | ||
| xcshareddata/ |
There was a problem hiding this comment.
I'm not sure why this was ignored in the first place, but the scheme details are a necessary part of the project now.
| let package = Package( | ||
| name: "google_mobile_ads", | ||
| platforms: [ | ||
| .iOS("13.0") |
There was a problem hiding this comment.
This is 13.0 rather than the 12.0 used in the podspec because webview-flutter-wkwebview requires 13, and Xcode enforces coherent min versions on a per-target level (unlike CocoaPods, which only fails if the final app has mismatches, which wasn't happening because any app built with a recent version of Flutter requires at least 13.0).
|
The example app still seemed to work and show ads, but since I'm not deeply familiar with the project, someone who is should likely do manual testing as well. |
|
@stuartmorgan-g do the mediation packages also require migration? https://github.com/googleads/googleads-mobile-flutter/tree/main/packages/mediation |
google_mobile_ads support for Swift Package Manager
|
I hadn't looked in there; I didn't realize they were all plugins as well. They will need migration, but it's not as urgent since the breakage reported in the issue is specific to having a dependency on another plugin in the podspec. I've updated my comment in the issue and this PR description to clarify that this only does the one package. |
| <string>arm64</string> | ||
| </array> | ||
| <key>MinimumOSVersion</key> | ||
| <string>13.0</string> |
|
Thanks @stuartmorgan-g! It seems some checks are failing but I feel it's because PR is behind some workflow fixes. Can you rebase so that we can retry the checks? |
|
@LTPhantom Looks like everything is passing now. (As a follow-up, you might want to configure your CI to explicitly build with SwiftPM enabled and with SwiftPM disabled, so that you have CI coverage of both modes.) |
* Initial restructure * Update paths in Xcode project * Adjust include paths for new file structure * Don't ignore shared xcode data * Automigration * Remove duplicate source references from example project to fix compilation * Add the webview_flutter_wkwebview dependency in SwiftPM * Manual scheme integration
`GoogleMobileAds` was SPM enabled in googleads/googleads-mobile-flutter#1395 Enabling SPM fixes flutter#185510 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
…s#1395) * Initial restructure * Update paths in Xcode project * Adjust include paths for new file structure * Don't ignore shared xcode data * Automigration * Remove duplicate source references from example project to fix compilation * Add the webview_flutter_wkwebview dependency in SwiftPM * Manual scheme integration
Description
Adds Swift Package Manager support to
google_mobile_ads:Related Issues
Fixes #1239
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. Updating the
pubspec.yamland changelogs is not required.///).flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?