Alipay+ Super App PlatformAlipay+ Super App Platform

Troubleshooting CocoaPods CDN Source

To integrate the IAPASAP SDK successfully, ensure your .netrc file is configured correctly. A misconfigured file can lead to errors when executing thepod installcommand.

Follow the steps below to troubleshoot any issues.

Step 1: Remove CocoaPods cache

To ensure that the latest CDN source is used, remove the CocoaPods cache from your local disk by following these steps:

  1. Go to the ~/.cocoapods/repo directory and remove the folder that is prefixed with i-v1-file-common-. This folder contains the metadata and the .podspec file of CocoaPods.
  2. Run the following command to remove the CocoaPods cache.
copy
pod cache clean IAPASAP --all; 

Step 2: Update your CocoaPods

CocoaPods version 1.10.0 or later is required. Run the following command to check your current version. Update if below the required version:

copy
pod --version

Step 3: Set up the .netrc file correctly

Ensure that the.netrc file is set up correctly with the following steps:

  1. Run the command below to verify if the .netrc file exists in your$HOME directory.
copy
cd ~; ls .netrc
  1. Ensure that the .netrc file contains the correct credentials for our server, as shown in Credentials.
  2. Run the following command to download the CocoaPods-version.yml file again.
copy
curl --netrc http://globaltech.alipay.com/api/v1/file/common/2017062215370883/minisdk/CocoaPods-version.yml

If the .netrc file is configured correctly, you should receive a response with status code301:

image.png

Step 4: Use Charles to check requests

After completing the previous steps, run thepod installagain. If successful, the issue is resolved. If not, use Charles to record the CLI requests for further analysis:

  1. Open Charles Proxy beforehand
  2. Run the following command (assuming that Charles is set to the default monitoring port of 8888):
copy
ALL_PROXY=http://localhost:8888 pod install

This command allows Charles to capture the CLI requests. Export the captured data and send it to the Solution Architect for help.