无法加载UITest捆绑包

Dim*_*tha 10 ios swift swift3

当我在手机中运行UITest时,它会安装并作为单独的应用程序运行,同时给出以下错误.

2017-07-27 10:44:33.892639 + 0700 XCTRunner [11886:3502890]正在运行测试... 2017-07-27 10:44:34.137927 + 0700 XCTRunner [11886:3502890]捆绑"... UITests"不能因为它已损坏或缺少必要的资源而无法加载.尝试重新安装捆绑包.2017-07-27 10:44:34.137999 + 0700 XCTRunner [11886:3502890](dlopen_preflight(/ var/containers/Bundle/Application/75C9B589-CCD4-480D-9E23-BA86878E8B37/... UITests-Runner.app/PlugIns /...UITests.xctest/...UITests):未加载库:@ rpath/GoogleToolboxForMac.framework/GoogleToolboxForMac参考自:/ var/containers/Bundle/Application/75C9B589-CCD4-480D-9E23-BA86878E8B37/.. .UITests-Runner.app/PlugIns/... UITests.xctest/... UITests原因:图片未找到)

我试图找到这个问题的解决方案超过一天.

我想将UITests添加到我现有的应用程序中,并将UITest目标添加到我的应用程序中.我正在使用迦太基和可可豆荚.我更新了pod文件和更新的pod,然后我将框架添加到由Carthage安装的UITest目标.

这是我的pod文件

platform :ios, '9.0'
use_frameworks!

target 'ExampleApp' do
    pod 'Charts'
    pod 'ReachabilitySwift', '~> 3'
    pod 'Fabric'
    pod 'Crashlytics'
    pod 'Google/Analytics'
    pod 'Firebase/Core'
    pod 'Firebase/Messaging'
end

target 'ExampleAppTests' do
    pod 'Charts'
    pod 'ReachabilitySwift', '~> 3'
    pod 'Fabric'
    pod 'Crashlytics'
end

target 'ExampleAppUITests' do
    pod 'Charts'
    pod 'ReachabilitySwift', '~> 3'
    pod 'Fabric'
    pod 'Crashlytics'
end
Run Code Online (Sandbox Code Playgroud)

这是我的cartfile

github "Alamofire/Alamofire" ~> 4.0
github "SwiftyJSON/SwiftyJSON" "3.0.0"
github "Friend-LGA/LGSideMenuController" ~> 1.0.0
github "TTTAttributedLabel/TTTAttributedLabel" ~> 1.13.4
github "MagicalPanda/MagicalRecord"
Run Code Online (Sandbox Code Playgroud)

我可以从堆栈溢出中找到一个相关的问题但不幸的是它没有帮助.你可以帮我把UITest目标添加到我的项目中而不会出现问题.

小智 12

Podfile

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

def base_pods
    pod 'FBSDKCoreKit', '4.24.0'
    pod 'FBSDKLoginKit', '4.24.0'
    pod 'FBSDKShareKit', '4.15.0'
    pod 'FacebookCore', '0.2.0'
    pod 'FacebookLogin', '0.2.0'
    pod 'FacebookShare', '0.2.0'
end
target 'App' do
  base_pods
    target 'AppTests' do
        inherit! :search_paths
        # Pods for testing
    end

    target 'AppUITests' do
        inherit! :complete
        # Pods for UI testing
    end
end
Run Code Online (Sandbox Code Playgroud)

这条线inherit! :complete是关键

并在UITest目标的设置中

在此输入图像描述

下一篇:

  • 明确派生数据
  • pod deintegrate && pod install