Xcode 10-UITests-原因:找不到图片 [英] Xcode 10 - UITests - Reason: image not found

查看:71
本文介绍了Xcode 10-UITests-原因:找不到图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的应用程序运行UItests,但是加载后它立即崩溃。这是错误。

I'm trying to run the UItests for my app but it's crashing as soon as it loads. Here's the error.

2018-09-29 16:19:49.577151+1000 xxxUITests-Runner[6007:69633] (dlopen_preflight(/Users/Acc/Library/Developer/Xcode/DerivedData/xxx-bjuwemcifadxhlhgojgfktmmades/Build/Products/Debug-iphonesimulator/xxxUITests-Runner.app/PlugIns/xxxUITests.xctest/xxxUITests): Library not loaded: @rpath/libswiftContacts.dylib
  Referenced from: /Users/Acc/Library/Developer/Xcode/DerivedData/xxx-bjuwemcifadxhlhgojgfktmmades/Build/Products/Debug-iphonesimulator/xxxUITests-Runner.app/PlugIns/xxxUITests.xctest/Frameworks/MapboxGeocoder.framework/MapboxGeocoder
  Reason: image not found)

我正在使用CocoaPods(1.6.0 .beta.1)来安装我的框架。我正在运行带有Swift 4.2和IOS 12的Xcode10。Git与其他开发人员一起用作版本控制(也许有冲突吗?)。

I'm using CocoaPods(1.6.0.beta.1) to install my frameworks. I'm running Xcode10 with swift 4.2 and IOS 12. Git is used as version control with other developers (Perhaps there're conflicts?).

我的目标应用程序在模拟器和真实手机上均可完美运行,因此我的单元测试也是如此。但是我的UITest目标一旦启动就会失败。这个问题在模拟器和真实机器上都会发生。

My target app works perfectly, both on a simulator and a real phone, and so does my unit tests. But my UITest target fails as soon as it launches up. This problem happens on both a simulator and a real machine.

以前有很多关于此问题的文章,但是到目前为止,没有一个文章对我有帮助。之前我有过两次孤立的事件,第一次是通过将依赖项添加到UITest单元的pod文件中来解决的,第二次是通过简单地删除目标并复制并删除了将类粘贴回新目标(无建设性,但不得已)。我这次也可以做同样的事情,但这有点浪费时间,我担心将来会再次出现。

There have been many posts on the issue before, but none of them have helped me so far. I've had 2 isolated occurrences before, the first time I've solved by adding dependencies into my pod file for the UITest unit, and the second time by simply removing my target and copy & pasting the classes back into the new target (unconstructive, but last resort). I can do the same this time as well but it's a bit of a waste of time and I'm afraid that this will crop up again in the future.

这是到目前为止,我所做的事情:

This is what I've done so far:


  1. 清理Xcode构建文件夹并删除派生数据,IOS设备日志和用户数据文件夹。

  1. Clean Xcode builds folder and deleted derived data, IOS device logs, and User Data folders.

重新启动Xcode,Mac以及我的设备和模拟器,重新克隆的存储库以及pod更新&&。 pod install

Restarted Xcode, Mac, as well as my device and simulators, and recloned repository, and pod update && pod install

将始终嵌入快速标准库设置为是

Have 'Always embed swift standard libraries' as yes

检查了我的目标应用程序正确

Checked my Target Application is correct

确保嵌入式Pod框架中包含有问题的框架(MapboxGeocoder.framework)

Made sure offending framework (MapboxGeocoder.framework) is included in Embed Pod Frameworks


推荐答案

所以5天后,我设法解决了自己的问题。

So after 5 days, I managed to solve my own problem.

我通过将UITests目标移出Podfile中的主应用程序范围来解决了这个问题。

I solved it by moving my UITests target out of the scope of my main app in Podfile.

发件人:

target 'App' do
    use_frameworks!

    pods 'Firebase'

    target 'AppUITests' do
        pods 'Testingpod'
    end
end

收件人:

target 'App' do
    use_frameworks!

    pods 'Firebase'
end

target 'AppUITests' do
    pods 'Testingpod'
end

这篇关于Xcode 10-UITests-原因:找不到图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆