loading...

How can we fix "UIWebView will no longer be accepted" ?

yasaricli profile image Yaşar İÇLİ ・1 min read

When I publish our React-native App, we get a warning like this.

The solution to this is to delete RCTWebView.

Let's solve this with Fastlane.

cd ios/fastlane/
touch fix-uiwebview.rb

The file fix-webview.rb is saved as follows.

fix-webview.rb

require 'xcodeproj'

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

then we open the Fastfile file and add the following to the bottom lane.

Fastfile


platform :ios do

  desc 'Deploy to AppStore'
  lane :release do
    fix_uiwebview
    upload_to_app_store
  end

  lane :beta do
    fix_uiwebview
    upload_to_testflight
  end

  desc "Fix deprecated UIWebView"
  private_lane :fix_uiwebview do
    sh("ruby", "fix-uiwebview.rb")
  end 

end

Thanks.

Posted on Jun 6 by:

Discussion

markdown guide