4

I am trying to add a pod dependency on the open edx ios project. The thing is the podfile has some sort of "post_install" script running after pod installation. The pod is installed, but the "post_install" failed with error. After it fails, further compilation results in a lot of "files not found" error.


Commenting out the "post_install" lines of code seems to work. But, the files not found error keeps on popping. Not to mention any additional pod installation also fails.

This is the Podfile

# Uncomment this line to define a global platform for your project
platform :ios, '9.0'

source 'https://github.com/CocoaPods/Specs.git'

project 'edX.xcodeproj'

target 'edX' do
     # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
    use_frameworks!

    # ignore all warnings from all pods
    inhibit_all_warnings!

    pod 'Analytics', '~> 3.6.10'
    pod 'Segment-GoogleAnalytics', '~> 1.2.0'
    pod 'Segment-Firebase', '=2.4.0'
    pod 'Crashlytics', '~> 3.10.1'
    pod 'DateTools', '~> 1.6.1'
    pod 'Fabric', '~> 1.7.6'
    pod 'GoogleSignIn', '~> 4.4.0'
    pod 'Masonry', '~> 0.6'
    pod 'NewRelicAgent', '~> 4.1'
    pod 'FBSDKCoreKit', '~> 4.42.0'
    pod 'FBSDKLoginKit', '~> 4.42.0'
    pod 'Smartling.i18n', '~> 1.0'
    pod 'Firebase/Core', '= 5.20.2'
    pod 'Firebase/InAppMessagingDisplay'
    pod 'Firebase/Analytics'
    pod 'Firebase/Performance'
    pod 'Branch', '= 0.25.5'
    pod 'YoutubePlayer-in-WKWebView', '~> 0.3.0'
end

target 'edXTests' do
    use_frameworks!
    pod 'iOSSnapshotTestCase', '= 5.0.2'
    pod 'OHHTTPStubs', '~> 4.0'
end

post_install do |installer|
    installer.pods_project.targets.each do |target|
        for i in 0..target.headers_build_phase.files.length - 1
            build_file = target.headers_build_phase.files[i]
            build_file.settings = { 'ATTRIBUTES' => ['Public']}
        end
        target.build_configurations.each do |config|
            config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = "YES"
        end
    end
end

[!] An error occurred while processing the post-install hook of the Podfile.

undefined method `headers_build_phase' for #

/Users/meme/XCodeProjects/S-Edx-iOS/Podfile:43:in block (3 levels) in from_ruby' /Users/meme/XCodeProjects/S-Edx-iOS/Podfile:42:ineach' /Users/meme/XCodeProjects/S-Edx-iOS/Podfile:42:in block (2 levels) in from_ruby' /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.7.5/lib/cocoapods-core/podfile.rb:179:inpost_install!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:836:in run_podfile_post_install_hook' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:824:inblock in run_podfile_post_install_hooks' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/lib/cocoapods/user_interface.rb:145:in message' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:823:inrun_podfile_post_install_hooks' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:309:in block in create_and_save_projects' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/lib/cocoapods/user_interface.rb:64:insection' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:290:in create_and_save_projects' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:281:ingenerate_pods_project' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/lib/cocoapods/installer.rb:159:in install!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/lib/cocoapods/command/install.rb:51:inrun' /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in run' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/lib/cocoapods/command.rb:52:inrun' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.7.5/bin/pod:55:in <top (required)>' /usr/local/bin/pod:23:inload' /usr/local/bin/pod:23:in `'

Vikrant
  • 4,920
  • 17
  • 48
  • 72
Thet Htun
  • 471
  • 5
  • 13

0 Answers0