PayHereLK / payhere-mobilesdk-reactnative

PayHere Mobile SDK for React Native
8 stars 6 forks source link

Swift WebKit Error in iOS Builds #9

Closed PayHereDevs closed 3 years ago

PayHereDevs commented 3 years ago

The following error message is logged when trying to build the iOS project.

Could not find or use auto-linked library 'swiftWebKit'

This is because the PayHere iOS SDK uses Swift files. Linking errors occur because the Swift Libraries are not linked by default when building React Native iOS projects.

In this case the steps to fix it are as follows.

  1. Open the .xcworkspace file in the ios directory with Xcode.
  2. On the Navigator Panel (left panel) you will see two Projects; click the down arrow on the top most one.
  3. When the project's files are expanded, right click on the first folder inside the Project you expanded.
  4. Click "New File"
  5. Select "Swift File" from the "iOS" tab and click "Next"
  6. Give the file any name (for example "File.swift") and save it.
  7. Xcode will prompt you to add a "Bridging File" - confirm the creation of a bridging file.
  8. Retry iOS build