Failed to load UITest package.

When I launch UITest on my phone, it is installed and launched as a separate application, but the following error appears.

2017-07-27 10: 44: 33.892639 + 0700 XCTRunner [11886: 3502890] Starting the test ... 2017-07-27 10: 44: 34.137927 + 0700 XCTRunner [11886: 3502890] package "... UITests" cannot be loaded because it is damaged or lack of necessary resources. Try reinstalling the package. 2017-07-27 10: 44: 34.137999 + 0700 XCTRunner [11886: 3502890] (Dlopen_preflight (/ var / containers / Pack / Application / 75C9B589-CCD4-480D-9E23-BA86878E8B37 / ... UITests-Runner.app/PlugIns /...UITests.xctest/...UITests): Library not loaded: @ rpath / GoogleToolboxForMac.framework / GoogleToolboxForMac Link from: / var / containers / Bundle / Application / 75C9B589-CCD4-480D-9E23-BA86878E8B37 / .. .UITests-Runner.app / PlugIns / ... UITests.xctest / ... UITests Reason: image not found)

I have been trying to find a solution to this problem for more than a day.

I wanted to add UITests to my existing application and add the target UITest program to my application. I use both carthage and cocoa -pod. I updated the pod file and updated the pod, and then added the frameworks to the UITest target that were installed using carthage.

This is my swap file.

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

This is my cart file

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"

I could find a related question from, but unfortunately this did not help. can you help me add the UITest goal to my project without any problems.

+4
source share
1 answer

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

inherit! :completethe key line here.

and in the settings for the UITest target

enter image description here

NEXT

  • clear received data
  • pod deintegrate && pod install
+1
source

Source: https://habr.com/ru/post/1682365/


All Articles