pubspec.yaml 中的 Flutter App 版本可以通过将条目更改为
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
但是,我创建了一个通知服务扩展来启用运行良好的 FCM 富文本推送通知。但是当我将此扩展的 Info.plist 值更改为与上面相同时,应用程序失败并出现以下构建错误:
Unable to install /Users/pa/development/FlutterApps/myApp/build/ios/iphonesimulator/Runner.app on <ID>. This is sometimes caused by a malformed plist file:
ProcessException: Process exited abnormally:
An error was encountered processing the command (domain=IXErrorDomain, code=2):
Failed to create plugin placeholder for /Users/pa/development/FlutterApps/myApp/build/ios/iphonesimulator/Runner.app/PlugIns/NotificationService.appex
Failed to create promise.
Underlying error (domain=IXErrorDomain, code=2):
Failed to set placeholder attributes com.mycompany.appid.NotificationService
Failed to create promise.
Command: xcrun simctl install <ID> /Users/pa/development/FlutterApps/myApp/build/ios/iphonesimulator/Runner.app
Error launching application on iPhone 11 Pro.
如何在 Extensions Info.plist 文件中使用相同的变量?我认为这只是一些配置,但我无法弄清楚。
谢谢!!