简体   繁体   English

Xcode 10,不构建pods不能构建项目

[英]Xcode 10, not building pods can't build project

After updating to the latest Xcode to support ios12 I can't build my project It seems that none of the pods are being compiled.更新到最新的 Xcode 以支持 ios12 后,我无法构建我的项目似乎没有任何 pod 正在编译。 I'm getting an error for unknown import such as "file not found" (ex 'SDWebImage/UIImageView+WebCache.h' file not found)我收到未知导入的错误,例如“找不到文件”(例如找不到“SDWebImage/UIImageView+WebCache.h”文件)

(if I comment everything related to this, it's just showing an error for the next package that does not exist) (如果我评论与此相关的所有内容,它只会显示下一个不存在的包的错误)

for plugins installed from pod.对于从 pod 安装的插件。

if I add the pod scheme and compile it, and then compile my project all the imports are working fine but then I get this compiler error for every package:如果我添加 pod 方案并编译它,然后编译我的项目,所有导入都可以正常工作,但是对于每个包,我都会收到此编译器错误:

Showing Recent Messages显示最近的消息

:-1: ignoring file 
/Users/administrator/Library/Developer/Xcode/DerivedData/XXXProject- 
ajmnddfiwycmqihdrqgzcltbrovs/Build/Products/Debug- 
iphonesimulator/Pods_XXXProject.framework/Pods_XXXProject, file was 
built for archive which is not the architecture being linked (i386): 
/Users/administrator/Library/Developer/Xcode/DerivedData/XXXProject- 
ajmnddfiwycmqihdrqgzcltbrovs/Build/Products/Debug- 
iphonesimulator/Pods_XXXProject.framework/Pods_XXXProject

My pod file is very simple, my projects have 3 extensions It worked fine before the update.我的 pod 文件非常简单,我的项目有 3 个扩展名 在更新之前运行良好。

I've tried removing, installing few times, updated my pod to 1.5.3 Nothing seems to work.我试过删除,安装几次,将我的 pod 更新到 1.5.3 似乎没有任何效果。 (tried even with the pod beta version 1.6) (即使使用 pod beta 1.6 版也尝试过)

Tried both Legacy and New System build getting same error for both.尝试了 Legacy 和 New System 构建,两者都出现了相同的错误。

In the project build phases, everything seems fine and should be copied.在项目构建阶段,一切看起来都很好,应该被复制。 (using use_frameworks!) (使用 use_frameworks!)

This is how my podfile looks like这就是我的 podfile 的样子

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

target ‘XXXXX’ do
    pod 'GoogleAnalytics'
    pod 'Firebase/Core'
    pod 'Firebase/Messaging'
    pod 'FBAudienceNetwork'
    pod 'FBSDKLoginKit'
    pod 'Fabric', '~> 1.7.6'
    pod 'Crashlytics', '~> 3.10.1'
    pod 'AccountKit'
    pod 'SDWebImage', '~> 4.0'
    pod 'BEMCheckBox'
end

Any ideas what's wrong?任何想法有什么问题?

This is the problem of your previous cache store in the derived data folder.这是您之前的缓存存储在派生数据文件夹中的问题。

Go to the DerivedData folder.转到 DerivedData 文件夹。 Close XCode.关闭 XCode。 Delete your apps from DerivedData folder.从 DerivedData 文件夹中删除您的应用程序。 Reopen XCode, clean project and run again.重新打开 XCode,清理项目并再次运行。

XCode preference > Locations > Derived Data (click right side icon in the directory path, it will open DerivedData folder) XCode 首选项 > 位置 > 派生数据(单击目录路径中的右侧图标,它将打开派生数据文件夹)

Select your pod from the left project navigator.从左侧的项目导航器中选择您的 pod。 > Select Target. > 选择目标。 > Select "Build Settings". > 选择“构建设置”。 > Build Active Architecture Only to No > 只建立主动架构到否

Here is another case: make sure "Scheme" > "Build" > "Find Implicit Dependencies" is turned on.这是另一种情况:确保“方案”>“构建”>“查找隐式依赖项”已打开。

I turned it off (tried to fix another problem) and spent quite some time trying to fix the build.我把它关掉(试图解决另一个问题)并花了很多时间来修复构建。

In my case就我而言

pod deintegrate
pod clean
pod install

then rebuild the project works.然后重建项目工程。

My XCode = 11.3.1我的XCode = 11.3.1

I had the same problem with Xcode 10 and newly added pods.我在 Xcode 10 和新添加的 pod 上遇到了同样的问题。

I've noticed new pod was not added to Target -> Build Phases -> Link Binary With Libraries.我注意到新的 pod 没有添加到 Target -> Build Phases -> Link Binary With Libraries。 When I added new pod-framework manually, archiving worked ok.当我手动添加新的 pod 框架时,归档工作正常。

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

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