PayHereLK / payhere-mobilesdk-reactnative

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

iOS Multiple Commands Produce ... Build Error #14

Closed PayHereDevs closed 2 years ago

PayHereDevs commented 2 years ago

When trying to build the React Native Project for iOS, the following error is shown.

Multiple commands produce '.../Assets.car':
1) Target '<Target>' (project '<Target>') has compile command with input '.../Images.xcassets'
2) That command depends on command in Target '<Target>' (project '<Target>>'): script phase “[CP] Copy Pods Resources”
PayHereDevs commented 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.

Step 1. Update to the New SDK

  1. Open your package.json file, and change the version of the React Native SDK Version as follows.
{
  "dependencies": {
    "@payhere/payhere-mobilesdk-reactnative": "2.0.0"
  }
}
  1. Run the npm install command in your React Native Project directory.

Step 2. Update iOS Cocoapods

  1. Navigate to the "ios" directory and open the "Podfile" file.

  2. 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

Step 3. Rebuild CocoaPods project

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.

  1. Open your Terminal and navigate to the "ios" folder in your React Native project.

  2. Run the command pod deintegrate

  3. Run the command pod install

  4. After installation, open your .xcworkspace file in Xcode.

  5. Click the Product > Clean Build Folder menu option in the Xcode Menu.

  6. Click the "Run" Button in Xcode.

Step 4: Troubleshooting is Complete.

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.

Further Notes