Reputation: 260
my pods are here
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'myAPP' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for myAPP
pod 'SwiftMessages'
pod 'IQKeyboardManager'
pod 'SwiftKeychainWrapper'
pod 'Tabman'
pod 'PagingMenuController'
pod 'Kingfisher'
pod 'Optik'
pod 'KRPullLoader'
pod 'AlamofireImage'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'TCPickerView'
pod 'GoogleMaps'
pod 'GooglePlaces'
pod 'Whisper'
pod 'Fabric'
pod 'Crashlytics'
pod 'SwiftyJSON'
pod 'Alamofire'
pod 'SwiftGridView'
target 'myAPPUITests' do
inherit! :search_paths
# Pods for testing
end
end
I am using swift 4, Xcode 10.1
I had try different solution but non of them work for me.
Upvotes: 3
Views: 6170
Reputation: 2335
My problem was solved adding the missing pods to the test target.
Looking similar to the below code:
target 'myAPP' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for myAPP
pod 'SwiftMessages'
pod 'IQKeyboardManager'
target 'myAPPUITests' do
inherit! :search_paths
# Pods for testing
pod 'SwiftMessages'
pod 'IQKeyboardManager'
end
end
Upvotes: 1
Reputation: 921
Check the test target and check for iOS Deployment Target.
Select APPUITests -> Build Settings -> Deployment -> iOS Deployment Target
In my case, I was running in iPhone SE(iOS 11.1) and my test target iOS Deployment Target was 13.1. I changed the iOS Deployment Target to 11.0 and worked fine for me.
Upvotes: 1
Reputation: 276
The bundle UITests couldn’t be loadedbecause it is damaged or missing necessary resources. Try reinstalling the bundle
Verify if all your targets are using the same iOS version in: Build Settings -> iOS Deployment Target
Upvotes: 7
Reputation: 4521
To install all dependencies, I added these lines to your Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
if ['PagingMenuController', 'TCPickerView'].include? target.name
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
end
Then I removed use_frameworks!
(see this link for more details) from your Podfile, run pod update
and after that I was able to run tests.
For more details see this answer.
Upvotes: 2
Reputation: 260
If you are using swift 3 or swift 4 and want to add UITest to your Project than don't forget following steps :
use_frameworks!
from your pod file and update your pod file with pod versions of dependencies like belowpost_install
to specify your swift version
.ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
Or set Them to No
in both target app (myAPP & myAPUITests)pod deintegrate
, pod clean
& pod install
# Uncomment the next line to define a global platform for your project platform :ios, '9.0'
target 'myAPP' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# Pods for myAPP
pod 'SwiftMessages', '4.1.4'
pod 'IQKeyboardManager', '6.1.1'
pod 'SwiftKeychainWrapper', '3.0.1'
pod 'Tabman', '1.9.1'
pod 'PagingMenuController', '2.2.0'
pod 'Kingfisher', '4.8.0'
pod 'Optik', '0.3.0'
pod 'KRPullLoader', '1.1.3'
pod 'AlamofireImage', '3.3.1'
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
pod 'TCPickerView', '0.2.5'
pod 'GoogleMaps', '2.7.0'
pod 'GooglePlaces', '2.7.0'
pod 'Whisper', '6.0.2'
pod 'Fabric', '1.7.9'
pod 'Crashlytics', '3.10.5'
pod 'SwiftyJSON', '4.1.0'
#pod 'Alamofire', '4.7.3'
pod 'SwiftGridView', '0.6.5'
target 'myAPPUITests' do
inherit! :search_paths
# Pods for testing
end
end
post_install do |installer|
print "Setting the default SWIFT_VERSION to 4.0\n"
installer.pods_project.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.0'
end
installer.pods_project.targets.each do |target|
if [].include? "#{target}"
print "Setting #{target}'s SWIFT_VERSION to 4.2\n"
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.2'
end
else
print "Setting #{target}'s SWIFT_VERSION to Undefined (Xcode will automatically resolve)\n"
target.build_configurations.each do |config|
config.build_settings.delete('SWIFT_VERSION')
#config.build_settings['SWIFT_VERSION'] = '4.0'
end
end
end
end
Upvotes: 1