syntax error: operand expected (error token is “$(CURRENT_PROJECT_VERSION)“)

298 篇文章 2 订阅

方法一:

UPDATE 2:

This causes builds to be canceled! Have a look at S1LENT WARRIOR's answer below, it seems to be working better.

UPDATE 1:

In the latest version of Xcode (Version 11.1) you can do the build number auto increment fairly easily.

Here are the steps:

Go to your target's Build Settings
Search for Versioning System
Set it's value to Apple Generic
Go to your target's Build Phases
Add a new Run Script
Add the following line agvtool next-version -all
Do this for all your targets and their build numbers will all be synced and updated every time you run any of the targets.

方法二

In Info.plist, set:

CFBundleShortVersionString to $(MARKETING_VERSION)
CFBundleVersion to $(CURRENT_PROJECT_VERSION)
In target build settings:

set Versioning System to "Apple Generic"
set Current Project Version to 1 (or whatever version you want)
set Marketing Version to 1.0.0 (or whatever version you want)
In the scheme > Archive:

add a post-action "Run Script Action":
Provide build settings from: your app
in the script: cd ${PROJECT_DIR} ; xcrun agvtool next-version -all ; 


方法三
Just change CFBundleVersion from $(CURRENT_PROJECT_VERSION) to number, in my case is 1000 in Info.plist

<key>CFBundleVersion</key>
<string>1004</string>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值