Library not loaded에서 UITests가 떨어질 때의 대처법

1723 단어 iOSCocoaPods
UITests가 Library not loaded 오류로 이끼를 잃어 버렸을 때의 메모

더 깨끗한 방법이 있다는 분은 교수하실 수 있습니다

환경



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

좋은 웹페이지 즐겨찾기