Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Combine Post Install in Podfile in React Native?

I need to add the following post install to the Podfile.

post_install do |pi|
  pi.pods_project.targets.each do |t|
    t.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
    end
  end
end

But encountered this error.

[!] Invalid `Podfile` file: [!] Specifying multiple `post_install` hooks is unsupported..

There are two post install in the Podfile. How should I combine them to resolve the error?

post_install do |installer|
    flipper_post_install(installer)
  end
end

post_install do |pi|
  pi.pods_project.targets.each do |t|
    t.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
    end
  end
end
like image 593
flyingspacecat Avatar asked May 05 '20 10:05

flyingspacecat


1 Answers

The following seems to work

  post_install do |installer|
    flipper_post_install(installer)
    installer.pods_project.targets.each do |t|
      t.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
      end
    end
  end
like image 76
Olivier Avatar answered Sep 20 '22 13:09

Olivier