Closed PayHereDevs closed 2 years ago
This issue is fixed in the PayHere React Native SDK version 2.0.0
and upwards. Please follow these steps as a complete guide to troubleshooting.
package.json
file, and change the version of the React Native SDK Version as follows.{
"dependencies": {
"@payhere/payhere-mobilesdk-reactnative": "2.0.0"
}
}
npm install
command in your React Native Project directory.Navigate to the "ios" directory and open the "Podfile" file.
Add a code line above pod 'payhere-mobilesdk-reactnative'
as shown below.
target 'MyApp' do
config = use_native_modules!
use_react_native!(
#...
# Add the next line!
pod 'payHereSDK', :git => 'https://github.com/PayHereDevs/payhere-mobilesdk-ios-rb.git'
pod 'payhere-mobilesdk-reactnative', :path => '../node_modules/@payhere/payhere-mobilesdk-reactnative'
#...
end
This step deletes the "Pods" folder, along with any custom build configurations for CocoaPods. Therefore, if you have such configurations it would be better to simply delete the .xcworkspace
file instead at the 2nd point. Further, note that this step will erase temporary content in your Build Folder. The next time you build the project it will take some time.
Open your Terminal and navigate to the "ios" folder in your React Native project.
Run the command pod deintegrate
Run the command pod install
After installation, open your .xcworkspace
file in Xcode.
Click the Product > Clean Build Folder menu option in the Xcode Menu.
Click the "Run" Button in Xcode.
Following the above steps should have resolved your issue. If you face any undocumented errors or issues, please state them below in this Issue. We can update this comment from such feedback, and it will serve as a central point of reference in the future.
To resolve issues with Resource linking we have introduced a variant of the previous iOS SDK. This is why you need to add the Git Repo of this new variant in your Podfile.
This is a one-time process. You won't need to do this everytime we release an update to the React Native SDK.
If you previously removed the "Target Membership" of your "Images.xcassets" file in the Xcode project, you can re-add it now.
In your Podfile
file, make sure that there are no lines stating "use_frameworks!". Adding it instructs CocoaPods to use dynamic frameworks and will cause building to fail.
We apologize for the inconvenience caused to you. Going forward, we will try our best to minimize this kind of problems.
When trying to build the React Native Project for iOS, the following error is shown.