2016-08-03 57 views
0

運行OSX的UI測試時,我想我的第一個自動化UI測試添加到我的應用程序和正在運行到相當多的困難的。SDK沒有找到圖片用的CocoaPods

該應用程序將建立在其當前狀態和主要應用程序本身運行良好。然而,當我嘗試運行我的測試中,我得到以下錯誤:

2016-08-02 19:39:33.340 XCTRunner[17590:966857] Running tests... 
2016-08-02 19:39:33.407 XCTRunner[17590:966857] The bundle 「MYAPPUITests」 couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. 
2016-08-02 19:39:33.407 XCTRunner[17590:966857] (dlopen_preflight(/Users/username/Library/Developer/Xcode/DerivedData/MYAPP-bdpxtxtxmsobtreqnojvykobjlts/Build/Products/Debug/MYAPPUITests-Runner.app/Contents/PlugIns/MYAPPUITests.xctest/Contents/MacOS/MYAPPUITests): Library not loaded: @rpath/HockeySDK.framework/Versions/A/HockeySDK 
    Referenced from: /Users/username/Library/Developer/Xcode/DerivedData/MYAPP-bdpxtxtxmsobtreqnojvykobjlts/Build/Products/Debug/MYAPPUITests-Runner.app/Contents/PlugIns/MYAPPUITests.xctest/Contents/MacOS/MYAPPUITests 
    Reason: image not found) 

我已經看到了有上這麼幾個相關的問題,但他們沒有看到來幫助我。

本來我是執行我的測試中雨燕上的目標C應用程序之上,並認爲可能是問題所在。但是,我做的是我遇到了一模一樣的問題目的C.

感謝所有幫助一個Objective-C基於測試目標後發現的。

編輯

一些額外的信息:我一直在使用這兩種的CocoaPods 0.39.0以及最新的非測試版本1.x的嘗試這個。兩者都導致相同的錯誤。

我podfile列出如下(爲0.39.0)

platform :osx, '10.9' 
link_with 'MYAPP', 'MYAPP MAS', 'MYAPPUITests' 


pod 'AFNetworking', '~> 2.5.0' 
pod 'ISO8601DateFormatter' 
pod 'CDEvents', :git => 'https://github.com/rastersize/CDEvents' 
pod 'MASShortcut', '1.3.1' 
pod 'libPusher', '1.6' 
pod 'NPReachability', :git => 'https://github.com/Abizern/NPReachability.git', :commit => 'e57753d' 
pod 'CocoaLumberjack' 
pod 'SocketRocket', :git => 'https://github.com/marianoabdala/SocketRocket.git' 
pod 'HockeySDK-Mac' 
pod 'INAppStoreWindow', '~> 1.4' 

回答

0

我能夠加入一個不起眼的步驟,我的構建階段願意花2-3天之後,以解決這個問題。

我在Link Binary With Libraries步驟之後和Embed Pods Frameworks步驟之前創建了一個Copy Files構建步驟。

我複製違規框架(「HockeySDK」),進入產品目錄。這解決了這個問題!

最終,這可能與我的應用程序是一個狀態欄應用程序,而不是一個普通的應用程序,作爲最後的工作對我來說是關係到運行同樣的漏洞一個命令行應用程序的解決方案。

Link to Github bug page with the solution that worked for me

Screenshot of Build Phases I created to solve the problem