Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
606 views
in Technique[技术] by (71.8m points)

xcode - React Native: where to add post_install script in podfile?

I've upgraded to XCode 12, and am following this article on how to resolve a simulator deployment target warning. It says to add the following post_install script to your podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
  end
end

but when I add it at the end of my podfile, I still get the same error: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'RNBackgroundFetch' from project 'Pods'), and others like it.

What I Want To Know: Where exactly in the podfile should I add the post_install script? There's a code block in my podfile that starts with target '<project name>' do, and at the end of this block I already have this code:

post_install do |installer|
    flipper_post_install(installer)
end

Should I add the recommended code to this existing post_install script? Or should I add a separate post_install script at the end of the podfile? Or something else? I've tried both and I still get the same simulator deployment target errors.

question from:https://stackoverflow.com/questions/65924958/react-native-where-to-add-post-install-script-in-podfile

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...