iosswiftcocoapodsappcode

When I use AppCode, I cannot use third-party libraries through CocoaPods


Premise

AppCode version:

AppCode 2019.3.5 Build #OC-193.6494.48, built on February 12, 2020

Language

Swift 5.0

CocoaPods:

version

CocoaPods 1.8.3

repo

cocoapods-
- Type: CDN
- URL:  https://cdn.cocoapods.org/
- Path: /Users/***/.cocoapods/repos/cocoapods-

ModuleSpecs
- Type: git (master)
- URL:  https://git.private pod source.com/***.git
- Path: /Users/***/.cocoapods/repos/ModuleSpecs

Specs
- Type: git (master)
- URL:  https://git.private pod source.com/***.git
- Path: /Users/***/.cocoapods/repos/Specs

Public podfile

source 'https://git.private pod source.com/***.git'
source 'https://cdn.cocoapods.org/'

workspace 'IM.xcworkspace'

platform :ios, '10.0'

use_frameworks!

#use_modular_headers!
inhibit_all_warnings!

install! 'cocoapods',
         :preserve_pod_file_structure => true,
         :generate_multiple_pod_projects => true
#         :incremental_installation => true

target 'IM' do

  project 'IM/IM.xcodeproj'

  # pod some private component

  pod 'Kingfisher'
  pod 'M13Checkbox'
  pod 'IQKeyboardManagerSwift'
  pod 'MJRefresh'

end

target 'Router' do

  project 'Router/Router.xcodeproj'

  # pod some private component

end

Question:

When I run my project using AppCode and manage third-party libraries through CocoaPods, I cannot use the code in the third-party library in the editor. but the project can run successfully! ?

Take a piece of code from Kingfisher as an example:

import Kingfisher

...

imageView.kf.setImage(with: URL (string: ""))
  1. I can't click Kingfisher with cmd + left click to preview Kingfisher's code
  2. This code is not highlighted in AppCode
  3. Nothing about kf in code hints, Means I need to manually write any method I need without any hint
  4. When I use cmd + left click on the setImage (with:) method, AppCode prompts Cannot find declaration to go to

However, with the exception of the second point, none of the above problems have occurred in my private pods, that is, only the pods in the CDN source (cocoapods-) have the above problems.

This has had a big impact on my development ... How can I solve this problem?

supplement:

I now suspect that there is a problem with the configuration of the CocoaPods in my AppCode.

Because a friend of mine's Preferences-> CocoaPods settings are shown below. The pod with the CDN source is included in the settings, and there are tips about the CDN source

enter image description here

But what I see below is that it only contains my private pods, no information about the shared pods, and no tips about the CDN

enter image description here


Solution

  • After I executed Clean,Clean Build Folder, Invalidate Caches numerous times, although the relevant code is still not highlighted, I can click to view the statement.

    I do n’t know which operation fixed the problem, if you have this problem, you can try more operations