fastlane: Snapshot run fails not finded libraries installed via pods
Issue Description
I’ve set up my project to use snapshot as indicated in it’s github repo. So I created a new target, namel PainntUITests and added it to xcode. I managed to get the tests (and the app itself) run in my device by tapping on the “Rec” button in xcode. However, when trying to run snapshot I get an error from the compiler saying it could not find AFNetworking library, which is one of many we install via cocoa pods. I guess there’s something I’m missing or not completely understanding. Any help or thought about it will be really appreciated.
Complete output when running snapshot, including the stack trace and command used
Mac-mini-de-lea:Painnt lea$ sudo snapshot --verbose
INFO [2016-04-29 17:22:51.71]: Fetching available simulator devices
WARN [2016-04-29 17:22:51.75]: xcrun xcodebuild -list -project './Painnt.xcodeproj'
INFO [2016-04-29 17:22:52.22]: Fetching available simulator devices
DEBUG [2016-04-29 17:22:52.26]: Found 12 simulators.
INFO [2016-04-29 17:22:52.26]: Fetching available simulator devices
DEBUG [2016-04-29 17:22:52.31]: Checking that helper files contain SnapshotHelperVersion [1.2]
+----------------------------+-------------------------------------------------------+
| Summary for snapshot 1.12.1 |
+----------------------------+-------------------------------------------------------+
| devices | ["iPhone 6"] |
| languages | ["de-DE"] |
| project | ./Painnt.xcodeproj |
| scheme | Painnt |
| output_directory | /Users/lea/Desktop/master/Painnt/fastlane/screenshots |
| launch_arguments | [""] |
| ios_version | 9.3 |
| skip_open_summary | false |
| clear_previous_screenshots | false |
| reinstall_app | false |
| erase_simulator | false |
| app_identifier | io.moonlighting.painnt |
| buildlog_path | ~/Library/Logs/snapshot |
| clean | false |
| number_of_retries | 1 |
| stop_after_first_error | false |
+----------------------------+-------------------------------------------------------+
INFO [2016-04-29 17:22:52.32]: Building and running project - this might take some time...
INFO [2016-04-29 17:22:52.32]: Patching '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' to scale simulator to 100%
INFO [2016-04-29 17:22:52.32]: Fetching available simulator devices
INFO [2016-04-29 17:22:52.37]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPhone-4s' '1.0'
INFO [2016-04-29 17:22:52.39]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPhone-5' '1.0'
INFO [2016-04-29 17:22:52.40]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPhone-5s' '1.0'
INFO [2016-04-29 17:22:52.41]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPhone-6' '1.0'
INFO [2016-04-29 17:22:52.43]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus' '1.0'
INFO [2016-04-29 17:22:52.44]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPhone-6s' '1.0'
INFO [2016-04-29 17:22:52.46]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus' '1.0'
INFO [2016-04-29 17:22:52.48]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPad-2' '1.0'
INFO [2016-04-29 17:22:52.49]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPad-Retina' '1.0'
INFO [2016-04-29 17:22:52.51]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPad-Air' '1.0'
INFO [2016-04-29 17:22:52.52]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPad-Air-2' '1.0'
INFO [2016-04-29 17:22:52.54]: $ defaults write '/Users/lea/Library/Preferences/com.apple.iphonesimulator.plist' 'SimulatorWindowLastScale-com.apple.CoreSimulator.SimDeviceType.iPad-Pro' '1.0'
DEBUG [2016-04-29 17:22:52.57]: Patching simulator to work with secure text fields
INFO [2016-04-29 17:22:52.57]: $ defaults write com.apple.iphonesimulator ConnectHardwareKeyboard 0
INFO [2016-04-29 17:22:52.64]: Fetching available simulator devices
INFO [2016-04-29 17:22:53.44]: ------------------------
INFO [2016-04-29 17:22:53.44]: --- iPhone 6 - de-DE ---
INFO [2016-04-29 17:22:53.44]: ------------------------
INFO [2016-04-29 17:22:53.44]: $ set -o pipefail && xcodebuild -scheme 'Painnt' -project './Painnt.xcodeproj' -derivedDataPath '/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j' -destination 'platform=iOS Simulator,id=85503EF9-3CF2-4163-8AE9-DF4868F7CE03,OS=9.3' build test | tee /Users/lea/Library/Logs/snapshot/Painnt-Painnt.log | xcpretty
INFO [2016-04-29 17:22:53.44]: ▸ Loading...
INFO [2016-04-29 17:22:54.01]: ▸ Building Painnt/Painnt [Debug]
INFO [2016-04-29 17:22:54.01]: ▸ Check Dependencies
INFO [2016-04-29 17:22:54.26]: ▸ Running script '📦 Check Pods Manifest.lock'
INFO [2016-04-29 17:22:54.27]: ▸ Precompiling Classes/Painnt-Prefix.pch
INFO [2016-04-29 17:22:55.70]: ▸ Compiling MLAppDelegate.m
INFO [2016-04-29 17:22:57.31]: ▸ ⚠️ /Users/lea/Desktop/master/libraries/Moonlighting_project/Application/MLAppDelegate.m:211:42: 'UITextAttributeTextColor' is deprecated: first deprecated in iOS 7.0 - Use NSForegroundColorAttributeName [-Wdeprecated-declarations]
INFO [2016-04-29 17:22:57.31]: ▸ [navBar setTitleTextAttributes:@{UITextAttributeTextColor : NavBarItemsColor7}];
INFO [2016-04-29 17:22:57.31]: ▸ ^
INFO [2016-04-29 17:22:57.31]: ▸ ⚠️ /Users/lea/Desktop/master/libraries/Moonlighting_project/Application/MLAppDelegate.m:390:10: unused variable 'handled' [-Wunused-variable]
INFO [2016-04-29 17:22:57.31]: ▸ BOOL handled = [[MLSocialViewController sharedInstance] handleReceivedNotification:userInfo appIsActive:application.applicationState == UIApplicationStateActive mainNavigation:self.navigationController];
INFO [2016-04-29 17:22:57.31]: ▸ ^
INFO [2016-04-29 17:22:57.31]: ▸ Compiling PNNPreviewViewController.m
INFO [2016-04-29 17:22:57.31]: ▸ Compiling PNNOptionsController.m
INFO [2016-04-29 17:22:57.32]: ▸ Compiling PNNAppDelegate.m
INFO [2016-04-29 17:22:57.32]: ▸ Compiling PNNShowEffectController.m
INFO [2016-04-29 17:22:57.34]: ▸ Compiling PNNMediaSelector.m
INFO [2016-04-29 17:22:57.34]: ▸ Compiling PNNAppRequestLoader.m
INFO [2016-04-29 17:22:57.40]: ▸ Compiling PNNSettingsViewController.m
INFO [2016-04-29 17:22:57.40]: ▸ ⚠️ /Users/lea/Desktop/master/Painnt/Classes/Settings/PNNSettingsViewController.m:43:10: unused variable 'shouldHide' [-Wunused-variable]
INFO [2016-04-29 17:22:57.40]: ▸ BOOL shouldHide = NO;//ramSize > 512;
INFO [2016-04-29 17:22:57.40]: ▸ ^
INFO [2016-04-29 17:22:57.40]: ▸ Compiling PNNHomeViewController.m
INFO [2016-04-29 17:22:57.41]: ▸ Compiling MLNeuralAppRequestLoader.m
INFO [2016-04-29 17:22:57.41]: ▸ Compiling PNNProgressViewController.m
INFO [2016-04-29 17:22:57.42]: ▸ Compiling SHKConfig.m
INFO [2016-04-29 17:22:57.42]: ▸ Compiling PNNEffectViewController.m
INFO [2016-04-29 17:22:57.42]: ▸ Compiling main.m
INFO [2016-04-29 17:22:57.43]: ▸ Linking Painnt
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/AFNetworking'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/Bolts'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/DraggableCollectionView'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/Facebook-iOS-SDK'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/GPUImage'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/HexColors'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/JTObjectMapping'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/KKGridView'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/MBProgressHUD'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/MMDrawerController'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/MagicalRecord'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/Moonlighting'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/Moonlighting_OpenGL'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/Moonlighting_ipvm_nolua'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/Moonlighting_torch'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/OMGHTTPURLRQ'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/PINCache'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/PKMultipartInputStream'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/PromiseKit'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/RaptureXML'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/Reachability'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/SAMTextView'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/SDCloudUserDefaults'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/SDWebImage'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/SSKeychain'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/SSZipArchive'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/ShareKit'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/SimpleExif'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/SlackTextViewController'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/TSMessages'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/TTTAttributedLabel'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/UIActivityIndicator-for-SDWebImage'
INFO [2016-04-29 17:22:57.44]: ▸ ⚠️ ld: directory not found for option '-L/var/root/Library/Developer/Xcode/DerivedData/Moonlighting-gmzboesymdhrlxdlpdnilaysjorb/Build/Products/Debug-iphoneos'
INFO [2016-04-29 17:22:57.44]: ▸ ❌ ld: library not found for -lAFNetworking
INFO [2016-04-29 17:22:57.45]: ▸ ❌ clang: error: linker command failed with exit code 1 (use -v to see invocation)
INFO [2016-04-29 17:22:57.46]: ▸ ** BUILD FAILED **
INFO [2016-04-29 17:22:57.46]: ▸ The following build commands failed:
INFO [2016-04-29 17:22:57.46]: ▸ Ld /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Build/Products/Debug-iphonesimulator/Painnt.app/Painnt normal x86_64
INFO [2016-04-29 17:22:57.46]: ▸ (1 failure)
INFO [2016-04-29 17:22:57.52]: ▸ 2016-04-29 17:22:57.520 xcodebuild[39414:160503] [MT] IDETestOperationsObserverDebug: (A9460601-A83D-4403-B89B-8F87A313F8CA) Beginning test session A9460601-A83D-4403-B89B-8F87A313F8CA with Xcode 7D175 on target <DVTiPhoneSimulator: 0x7f97e4de8030> {
INFO [2016-04-29 17:22:57.52]: ▸ SimDevice: SimDevice : iPhone 6 (85503EF9-3CF2-4163-8AE9-DF4868F7CE03) : state={ Shutdown } deviceType={ SimDeviceType : com.apple.CoreSimulator.SimDeviceType.iPhone-6 } runtime={ SimRuntime : 9.3 (13E230) - com.apple.CoreSimulator.SimRuntime.iOS-9-3 }
INFO [2016-04-29 17:22:57.52]: ▸ } (9.3 (13E230))
INFO [2016-04-29 17:22:57.52]: ▸ 2016-04-29 17:22:57.521 xcodebuild[39414:160518] IDETestOperationsObserverDebug: Writing diagnostic log for test session to:
INFO [2016-04-29 17:22:57.52]: ▸ /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/snapshot_derived20160429-39364-1u8518j/Logs/Test/CA0AF4F7-67E8-4901-B9EA-B4057D0FE19B/Session-2016-04-29_17:22:57-wKXlZr.log
My Snapfile & Podfile
Snapfile:
# A list of devices you want to take the screenshots from
devices([
"iPhone 6",
])
languages([
"de-DE",
])
# Arguments to pass to the app on launch. See https://github.com/fastlane/snapshot#launch-arguments
# launch_arguments(["-favColor red"])
# The name of the scheme which contains the UI Tests
# scheme "SchemeName"
# Where should the resulting screenshots be stored?
# output_directory "./screenshots"
# clear_previous_screenshots true # remove the '#' to clear all previously generated screenshots before creating new ones
# Choose which project/workspace to use
# project "./Project.xcodeproj"
# workspace "./Project.xcworkspace"
# For more information about all available options run
# snapshot --help
target Painnt do
pod 'MyPod', :path => 'pathToMyPod.podsepc'
targetTest = '%sUITests' % [Painnt]
target targetTest do
inherit! :search_paths
#pod 'MyPod', :path => 'pathToMyPod.podsepc'
end
end
I’ve also added the libPods to the created UITestTarget to it’s ‘Link with Binary libraries’ as depicted here: http://prnt.sc/aygym7
Environment
snapshot version: 1.12.1
Do you use bundler to execute fastlane (i.e. bundle exec fastlane
)? No
Do you use a Ruby environment manager (e.g. chruby
, rbenv
, rvm
)? No
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 30 (5 by maintainers)
@mfurtak Hi, thanks for reaching out! When I read this I was not in the office any more. On thursday (tomorrow is a holiday in my country) I’ll go back and try options in the SO question you’ve kindly provided. As soon as I do, I’ll post the outcome here.
Once again, thanks a lot.
@TKBurner Sure thing! But I’ll have to wait until Tuesday that’s when I’ll have access to my work Mac (long weekend again 😕)
I’ve discovered where the
reset_simulators
error is coming from:This is probably happening because (like me) you have some simulators in bad states:
As you can see from the IDs, snapshot is choosing
D2C4CBD0-DF62-45E3-8E25-72201827482E
as the watch simulator to pair, and that one isn’t in a state where that will work. I’ll put together a fix for that.@leandrodemarco Thanks for working with us. I sent this out to the core team. If anyone is able to come up with reproduction steps that’ll help a ton. Thanks!
@TKBurner will do tomorrow and post it. Thanks for the reply!