Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Multiple Commands Produce ... Build Error #14

Closed
PayHereDevs opened this issue Oct 26, 2021 · 1 comment
Closed

iOS Multiple Commands Produce ... Build Error #14

PayHereDevs opened this issue Oct 26, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@PayHereDevs
Copy link
Contributor

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 PayHereDevs added the bug Something isn't working label Oct 26, 2021
@PayHereDevs
Copy link
Contributor Author

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant