简体   繁体   English

当我使用 AppCode 时,我无法通过 CocoaPods 使用第三方库

[英]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 AppCode 2019.3.5 Build #OC-193.6494.48,建于2020年2月12日

Language

Swift 5.0斯威夫特 5.0

CocoaPods:可可豆:

version版本

CocoaPods 1.8.3可可豆 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 .当我使用 AppCode 运行我的项目并通过 CocoaPods 管理第三方库时,我无法在编辑器中使用第三方库中的代码。 but the project can run successfully !但是项目可以成功运行 ? ?

Take a piece of code from Kingfisher as an example:Kingfisher的一段代码为例:

import Kingfisher

...

imageView.kf.setImage(with: URL (string: ""))
  1. I can't click Kingfisher with cmd + left click to preview Kingfisher's code我无法点击Kingfishercmd + left click预览翠鸟的代码
  2. This code is not highlighted in AppCode此代码未在 AppCode 中突出显示
  3. Nothing about kf in code hints, Means I need to manually write any method I need without any hint代码提示中没有关于kf ,这意味着我需要手动编写我需要的任何方法而没有任何提示
  4. When I use cmd + left click on the setImage (with:) method, AppCode prompts Cannot find declaration to go to当我使用cmd + left click setImage (with:)方法时,AppCode提示Cannot find Declaration to go

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.但是,除了第二点,我的私有pod中没有出现以上问题,即只有CDN源( cocoapods- )中的pod出现上述问题。

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.我现在怀疑我的AppCode中CocoaPods的配置有问题。

Because a friend of mine's Preferences-> CocoaPods settings are shown below.因为我朋友的Preferences->CocoaPods设置如下图。 The pod with the CDN source is included in the settings, and there are tips about the CDN source设置里面有带CDN源的pod,还有关于CDN源的提示

在此处输入图片说明

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但是我在下面看到的是它只包含我的私人 Pod,没有关于共享 Pod 的信息,也没有关于 CDN 的提示

在此处输入图片说明

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.在我多次执行CleanClean Build FolderInvalidate Caches ,虽然相关代码仍未突出显示,但我可以单击查看语句。

I do n't know which operation fixed the problem, if you have this problem, you can try more operations不知道是哪个操作解决了问题,如果你有这个问题,可以尝试更多操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM