Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

[iOS] New Version in NPM has podfile error during build #684

Closed
vtjon opened this issue Apr 25, 2018 · 4 comments
Closed

[iOS] New Version in NPM has podfile error during build #684

vtjon opened this issue Apr 25, 2018 · 4 comments
Assignees
Milestone

Comments

@vtjon
Copy link

vtjon commented Apr 25, 2018

My project is in an automated build environment and I noticed that it started to fail today. It appears that this plugin was updated to version 5.3.0 and the way XCode merges the podfile is incorrect. I only have Admob and Messaging enabled in my app. If I look at my podfile, I have the following:

 pod 'Firebase', '~> 4.11.0' 
pod 'Firebase/Auth'

# Uncomment if you want to enable Realtime DB
#pod 'Firebase/Database'

# Uncomment if you want to enable Cloud Firestore
#pod 'Firebase/Firestore'

# Uncomment if you want to enable Remote Config
#pod 'Firebase/RemoteConfig'

# Uncomment if you want to enable Crash Reporting
#pod 'Firebase/Crash'

# Uncomment if you want to enable Crashlytics
#pod 'Fabric'
#pod 'Crashlytics'
# Crashlytics works best without bitcode
#def post_install4 (installer)
#    installer.pods_project.targets.each do |target|
#        target.build_configurations.each do |config|
#            config.build_settings['ENABLE_BITCODE'] = "NO"
#        end
#    end
#end

# Uncomment if you want to enable FCM (Firebase Cloud Messaging)
pod 'Firebase/Messaging'

# Uncomment if you want to enable Firebase Storage
#pod 'Firebase/Storage'

# Uncomment if you want to enable AdMob
pod 'Firebase/AdMob'

# Uncomment if you want to enable Invites and/or Dynamic Links
#pod 'Firebase/Invites'

However, in the post_install steps, I have:

post_install do |installer|
  post_install1 installer
  post_install2 installer
  post_install3 installer
  post_install4 installer
end

post_install4 should not be there in this case and was causing a build error. I have not had a chance to look into exactly why.

@EddyVerbruggen
Copy link
Owner

Let me know if you find out more. This doesn’t ring a bell for me.

@vtjon
Copy link
Author

vtjon commented Apr 25, 2018

Here are the steps to duplicate
tns create pod-test --ng
cd pod-test
tns plugin install nativescript-plugin-firebase - Just select messaging and admob
tns plugin install @nstudio/nativescript-camera-plus - I think you just need another plugin that has a post install step
tns prepare ios

The prepare will fail. If you look at the resulting PodFile, it will have attempted to merge the commented out post install steps for Crashlytics. I'm guessing this is some type of Cocoapod bug. I tried a mult-line ruby comment for the post install steps and it still did the same thing.

I am using:

  • Nativescript CLI 3.4.3
  • XCode 9.3
  • Cocoapods 1.4.0

@vcooley
Copy link
Contributor

vcooley commented Apr 26, 2018

@EddyVerbruggen this is happening to me as well.

It looks like if you are not using Crashlytics, the post install definition remains commented while the invocation is not. You can reproduce this error by setting the Crashlytics property to false in the project firebase config file.

@EddyVerbruggen EddyVerbruggen added this to the 5.3.1 milestone Apr 26, 2018
@EddyVerbruggen EddyVerbruggen self-assigned this Apr 26, 2018
@EddyVerbruggen
Copy link
Owner

EddyVerbruggen commented Apr 26, 2018

"the post install definition remains commented while the invocation is not"

Exactly! 👌🏻

Thanks for reporting this guys!

Seems like a bug in the NativeScript's Podfile merger that I'll need to work around by not including the commented section at all.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants