Setting iOS Today Extension bundle version to Flutter FLUTTER_BUILD_NUMBER
Asked Answered
T

2

5

I have a flutter application, that also has an iOS native Today extension.

When I change the version on the project's yaml, the "Runner" target gets its version automatically, but the extension target needs to be updated manually.

Is there a way to automate it?

Taxpayer answered 2/11, 2021 at 9:56 Comment(0)
B
11

First, you need to update the extension Info.plist files with Flutter params:

<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>

Now you need to have these Flutter parameters available for the widget. To do so, you need to include Flutter/Generated.xcconfig file in the Extension configuration file. On Xcode, select Project->Runner-, under “info” open “configurations”, [image2] Look for the Extension configuration file, and add the following: #include “Generated.xcconfig” Run ‘flutter clean; flutter run’ and the version should be updated

Bootleg answered 9/11, 2021 at 12:58 Comment(2)
I had to manually add some xcconfig files for my extension, but your answer saved me. Thank you!Fein
In addition to this, I also had to go into the Build Settings of the Extension's target and change the values of Current Project Version and Marketing VersionHenchman
A
0

if you have change version extension/package in pubspec.yaml, before you run project on XCode, you can try update your pod first, open cd project/ios/ and hit pod install --repo-update so your pod on XCode already update with new version package

Allyson answered 6/11, 2021 at 17:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.