ios - 通过传递环境变量 Xcode 更改应用程序名称
问题描述
我想要做的是通过在使用构建应用程序时传递环境变量来更改应用程序名称flutter run --dart-define=COMPANY_NAME="FIAMM"
。
在我的 Xcode 项目 -> 目标 -> 构建设置 -> 产品名称中:
如果我运行flutter run --dart-define=COMPANY_NAME="FIAMM"
,编译器会显示此错误:
** BUILD FAILED **
Xcode's output:
↳
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in parallel
error: Multiple commands produce
'/Users/fabiosacilotto/Flutter/topclass_wip/build/ios/Debug-iphoneos/.app':
1) Target 'Runner' has link command with output
'/Users/fabiosacilotto/Flutter/topclass_wip/build/ios/Debug-iphoneos/.app'
2) Target 'Runner' has create directory command with output
'/Users/fabiosacilotto/Flutter/topclass_wip/build/ios/Debug-iphoneos/.app'
/Users/fabiosacilotto/Flutter/topclass_wip/ios/Pods/Pods.xcodeproj: warning:
The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but
the range of supported deployment target versions is 9.0 to 15.0.99. (in
target 'Flutter' from project 'Pods')
warning: duplicate output file
'/Users/fabiosacilotto/Flutter/topclass_wip/build/ios/Debug-iphoneos/.app'
on task: MkDir
/Users/fabiosacilotto/Flutter/topclass_wip/build/ios/Debug-iphoneos/.app (in
target 'Runner' from project 'Runner')
Could not build the precompiled application for the device.
It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
open iOS/Runner.xcworkspace
相反,如果我在之前/之后添加一些东西$(COMPANY_NAME)
,编译器会构建应用程序而不会出现任何错误。
有没有办法让它构建应用程序只留下$(COMPANY_NAME)
?
解决方案
推荐阅读
- java - String 数组引用如何存储在 Object 数组的引用变量中?
- sql - postgresql 查询以生成具有多列的报告
- flutter - 如何设计文本域
- python - 如何更改 scipy curve_fit/least_squares 步长?
- python - Discord.py 排名命令
- javascript - 为什么这会在 Web 控制台编译器中显示以及如何修复它并找到值
- excel - Worksheet_Change Target.Address 在特定工作表上
- java - Project Euler #14 输出的输出不正确
- javascript - 如何根据数据属性对父 div 中的子 div 进行排序?
- javascript - d3.js 分子图仅适用于对象的最后一个元素