0

I got a deprecated error while uploading the build to testflight, because of the UIWebView.

So I have removed the RCTWebView.m, RCTWebView.h, RCTWebViewManager.m, RCTWebViewManager.h and then I not found the UIWebview for some time.

But here again it get added in my Libraries under React.Xcodeproj. How can I remove this entirely?

sejn
  • 2,040
  • 6
  • 28
  • 82

2 Answers2

0

You deleted the files from a library you are including. When you perform the activity that installs the library again it will replace the one you changed with the version specified by your build. To fix permanently you need to speicfy a version of the react library that does not have these files

Martin Lockett
  • 2,275
  • 27
  • 31
  • I am using react-native-device-info package. I have the latest version of this package. UIWebView is added from this package only.After updating the version, still I need to remove that manually. Can you have any solution? – sejn Apr 05 '20 at 17:56
0

If you have Cocoapods in your project, you could add a post_install script in your Podfile.

The post_install script would be something like this:

react_project = Xcodeproj::Project.open("../node_modules/react-native/React/React.xcodeproj")
    react_project.main_group["React/Views"].files.each do |file|   
      if file.path.match(/^RCTWebView/) 
        file.remove_from_project
      end   
    end   
react_project.save

Your node_modules directory might be different from the code I posted above, so you might want to update it.

The code above tries to remove any header (.h) or class implementation (.m) files that contain RCTWebView after pod installation

Ref: https://github.com/facebook/react-native/issues/26255#issuecomment-528275747

Than
  • 3
  • 2