7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Library not loadedでUITestsが落ちるときの対処法

Last updated at Posted at 2018-10-10

UITestsがLibrary not loadedエラーでコケてどうしようもならなくなったときのメモ

もっと綺麗な方法があるという方はご教授いただけると助かります :bow:

環境

macOS X 10.13.6 High Sierra
Xcode 10.0
Swift4
CocoaPods 1.5.3

エラー概要

以下のようなエラーが出て無限にUITestがコケる

2018-10-10 12:27:45.167616+0900 SampleAppUITests-Runner[54613:9899852] The bundle “SampleAppUITests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle.
2018-10-10 12:27:45.167698+0900 SampleAppUITests-Runner[54613:9899852] (dlopen_preflight(/Users/hoge/Library/Developer/Xcode/DerivedData/SampleApp-gjaybkosyiuyhtacrtscxsyafqsq/Build/Products/Debug-iphonesimulator/SampleAppUITests-Runner.app/PlugIns/SampleAppUITests.xctest/SampleAppUITests): Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit

対処法

CocoaPodsを使用していると、UITestsで必要なフレームワークがUITests Schemeに組み込まれない場合があります。

とりあえず、私は以下のようにして対処しました。

# Uncomment the next line to define a global platform for your project
#platform :ios, '9.0'

target 'SampleApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for SampleApp

  pod 'FBSDKCoreKit'

  target 'SampleAppTests' do
    inherit! :search_paths
  end

  target 'SampleAppUITests' do
    inherit! :search_paths
+   pod 'FBSDKCoreKit'
  end

end
7
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?