簡體   English   中英

如何在 React Native 中結合 Podfile 中的 Post Install?

[英]How to Combine Post Install in Podfile in React Native?

我需要將以下安裝后添加到 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

但是遇到了這個錯誤。

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

Podfile 中有兩個 post install。 我應該如何結合它們來解決錯誤?

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

以下似乎有效

  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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM