I need to add post_install script to my project because of error :
note: compiling as Swift 3.3.2, with 'ActiveLabel' built as Swift 4.1.2 (this is supported but may expose additional compiler issues)
I added suggested solution from GitHub:
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'ActiveLabel' target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '4.1' end end end end
my Podfile looks:
target 'Name' do
use_frameworks!
common_dependencies()
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'ActiveLabel' target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '4.1' end end end
end
I have error from console:
[!] Invalid
Podfilefile: syntax error, unexpected tIDENTIFIER, expecting keyword_then or ';' or '\n' ...et.name == 'ActiveLabel' target.build_configurations.each do... ... ^.
What is wrong with this syntax ? common_dependencies just init all pods.
I think you are missing the pod installation part here.
Your podfile should look like this :
target 'Name' do
use_frameworks!
common_dependencies()
pod 'ActiveLabel'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'ActiveLabel' target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With