Bruno Lopes Bacelar
Bruno Lopes Bacelar

Reputation: 125

Invalid `Podfile` file: syntax error, unexpected end-of-input, expecting keyword_end

I'm having an error that only happens to me. My colleagues don't get the same error and we share the same code. I'm trying to pod install but I'm getting this error:

Invalid Podfile file: syntax error, unexpected end-of-input, expecting keyword_end.

My pod version is: 1.5.3

Here is the link to my pod file: https://gist.github.com/brunocuratio/6240bcaf69adcfae5c9026086b466cb7

Upvotes: 5

Views: 19650

Answers (3)

JMS
JMS

Reputation: 1

Just delete the Podfile and build again. It should create a new one without any issues.

Upvotes: -2

Manoj Daswani
Manoj Daswani

Reputation: 611

When I had this error

[!] Invalid Podfile file: syntax error, unexpected end, expecting end-of-input. What worked for me was

  1. I had removed the Podfile from the project folder which had an error and then
  2. Opened and added all the necessary dependencies in the new Podfile, then
  3. Did pod install on the terminal and the error had gone.

May work for some. Good luck !!

Upvotes: 0

Gleb A.
Gleb A.

Reputation: 1180

The first two if statements in the post_install hook seem to have their ends missing. This should work:

post_install do |installer|
    installer.pods_project.targets.each do |target|
        if target.name == 'NMessenger'
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '3.0'
            end
        end
        if target.name == 'Kingfisher'
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.2'
            end
        end
        if target.name == 'PopupDialog'
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.2'
            end
        end
    end
end

Upvotes: 4

Related Questions