I have integrated Alamofire in my ios project.While am testing my app using XCTest(UITest),am getting the following issue.I have googled and tried all the solutions.But not getting the solutions.Plesae help me to solve this.
Library not loaded: #rpath/Alamofire.framework/Alamofire Referenced from: /private/var/mobile/Containers/Bundle/Application/DA4702F0-6A4C-4EB6-99D0-255ABB6E3F57/Real Estate.app/Real Estate Reason: image not found Dyld Version: 353.12
this is my podfile.
target 'FreshBoss' do
use_frameworks!
# Pods for FreshBoss
pod 'Alamofire', '~> 3.4'
pod 'MBProgressHUD', '~> 0.9.2'
pod 'Google/SignIn'
target 'FreshBossTests' do
inherit! :search_paths
# Pods for testing
pod 'Alamofire', '~> 3.4'
pod 'MBProgressHUD', '~> 0.9.2'
pod 'Google/SignIn'
end
target 'FreshBossUITests' do
inherit! :search_paths
# Pods for testing
pod 'Alamofire', '~> 3.4'
pod 'MBProgressHUD', '~> 0.9.2'
pod 'Google/SignIn'
end
end
Embed Pods framework is the reason for this.UITest -> Buildphases ->
Embed Pods framework is missing.Copy from target and paste it in UITest target.It worked for me.
Related
I have an iOS project with 2 development targets and 1 unit test target. The development targets are hybrid (using Objective-c and Swift at the same time), thus I have to use Bridging-Header.h within the project.
The problem is when I want to import the module into my unit test class using the following code:
#testable import <Module>
By adding the above line, unit tests stop building and output the following error:
/Users/admin/Projects/<Project>/Tests/<TestClass>.swift:10:18: Failed to import bridging header '/Users/admin/Projects/<Project>/Core_Services_Interfaces/<Module>-Bridging-Header.h'
It seems it has some kinds of problems with imported Objective-c pods.
Any help in resolving the problem is appreciated.
P.S: My Podfile:
target '<TARGET_1>' do
platform :ios, '8.0'
inhibit_all_warnings!
pod 'GoogleAnalytics'
pod 'GoogleIDFASupport'
pod 'GoogleAPIClient/Calendar', '~> 1.0.2'
pod 'GTMOAuth2', '~> 1.1.0'
pod 'GoogleMaps'
pod 'MARKRangeSlider'
pod 'MGSwipeTableCell'
pod 'KVNProgress'
pod 'Adjust', '~> 4.11.0'
pod 'HCSStarRatingView', '~> 1.5'
pod 'SDWebImage', '~>3.8'
pod 'MMPopupView'
pod "MXPagerView"
pod 'AppAnalytics'
pod 'MXSegmentedPager'
pod 'MBProgressHUD', '~> 1.1.0'
pod 'PKHUD', '~> 4.0'
pod 'DeviceGuru'
use_frameworks!
pod 'Alamofire', '~> 4.7'
pod 'ObjectMapper', '~> 3.3.0'
pod 'RealmSwift'
pod 'netfox'
pod 'KeychainSwift', '~> 11.0'
pod 'NVActivityIndicatorView'
pod "PullToRefreshKit" , "~> 0.6.0"
pod 'MaterialShowcase'
pod 'Segmentio', '~> 3.2'
target '<TARGET_2>' do
inherit! :complete
end
target '<TEST_TARGET>' do
inherit! :complete
end
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name.include?('MaterialShowcase')
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.2'
end
end
end
end
end
Good afternoon,
After updating to the latest version of Cocoapods (1.0) my iOS application shows a lot of errors. I'm not sure why is this happening because during the update everything was correct, but when I "Run" my app, it shows the following errors:
And that's my Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'myApp' do
pod 'HanekeSwift', '~> 0.10'
pod 'Alamofire', '~> 3.3'
pod 'SwiftyJSON', '~> 2.3'
pod 'Batch', '~> 1.5'
end
target 'myAppTests' do
end
target 'myAppUITests' do
end
What can I do in order to solve those problems?
Much appreciated,
Regards.
If you ran pod install and its still not working.
Try pod deintegrate and then pod install. It should fix the issue.
If someone has the same problem, I have deleted the old Podfile and create a new one. And now that's how it looks like:
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
target 'myApp' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for myApp
pod 'Alamofire', '~> 3.4'
pod 'SwiftyJSON', '~> 2.3'
pod 'HanekeSwift', '~> 0.10'
pod 'Batch', '~> 1.5'
target 'myAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'myAppUITests' do
inherit! :search_paths
# Pods for testing
end
end
I can compile the target with debug configuration, but when change to release configuration, it failed with error:
ld: framework not found Pods_MyTarget
this is the pod file:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
pod 'SnapKit', '~> 0.15.0'
pod 'ObjectMapper', '~> 0.19'
pod 'Nuke'
pod 'Nuke-Alamofire-Plugin'
pod 'RESideMenu', '~> 4.0.7'
pod 'XCGLogger', '~> 3.0'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'TTTAttributedLabel'
pod 'UIColor_Hex_Swift', '~> 1.4'
pod 'RxSwift', '~> 2.0.0-beta'
pod 'RxCocoa', '~> 2.0.0-beta'
pod 'RxBlocking', '~> 2.0.0-beta'
I have seen this bug many a times. I do the below workaround, this may not be the right fix.
Go to Project settings and change "Build Active Architecture Only" to "NO".
I found that I have to change the pod file to something like this:
link_with 'xxx'
target xxx do
pod xxxxxx
end
and then delete some files generated by pod manually, seems pod cannot delete them, such as the xcconfig, framework, .etc
then run 'pod install'
it works.
I have been unable to get Cocoapods to build a deployable iOS app that requires different pods for the app and the watchkit extension. I have tried a format suggested in another thread: Include pods in main target and not in WatchKit extension
but it has numerous failures, including not finding headers. Here's the closest I can get:
source 'https://github.com/CocoaPods/Specs.git'
link_with 'RailTime-WatchKit-Extension'
pod 'Reachability'
pod 'IGInterfaceDataTable'
target :'RailTime', :exclusive=>true do
pod 'ASIHTTPRequest', '~> 1.8.2'
pod 'BPXLUUIDHandler', '~> 0.0.1'
pod 'MBProgressHUD', '~> 0.9'
pod 'Appirater', '~> 2.0.4'
end
This works fine for the simulator, but fails when trying to install on a device. The first error is:
ld: library not found for -lPods-RailTime-WatchKit-Extension
I'm using the latest Cocoapods right now .37. No errors are generated when performing a pod install.
Any help would be greatly appreciated!
Ken
Here's the general format that I use for my WatchKit app. See if this helps:
source 'https://github.com/CocoaPods/Specs.git'
target 'RailTime-WatchKit-Extension' do
link_with 'RailTime-WatchKit-Extension'
pod 'Reachability'
pod 'IGInterfaceDataTable'
end
target :'RailTime' do
link_with 'RailTime'
pod 'ASIHTTPRequest', '~> 1.8.2'
pod 'BPXLUUIDHandler', '~> 0.0.1'
pod 'MBProgressHUD', '~> 0.9'
pod 'Appirater', '~> 2.0.4'
end
OK, the solution was quite simple, even though I'm not sure why it worked. As suggested in another thread, I did a 'pod init', which now creates a template that is knowledgable about the multiple targets. I then just filled it in! Here's what I have now:
platform :ios, '8.2'
source 'https://github.com/CocoaPods/Specs.git'
target 'RailTime' do
pod 'Reachability'
pod 'ASIHTTPRequest', '~> 1.8.2'
pod 'BPXLUUIDHandler', '~> 0.0.1'
pod 'MBProgressHUD', '~> 0.9'
pod 'Appirater', '~> 2.0.4'
end
target 'RailTime-WatchKit-Extension' do
pod 'Reachability'
pod 'IGInterfaceDataTable'
end
target 'RailTime-WatchKit-App' do
end
I'm working on a legacy iOS project as a newbie. After I updated the CocoaPods and libraries, I've got these weird errors after building the project which never happen before.
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lPods-Model
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lPods-Model is not an object file (not allowed in a library)
And here is my Podfile:
platform :ios, '7.0'
link_with ['DianaViewModels']
pod 'AVOSCloud', '~> 3.0'
pod 'PixateFreestyle'
target :Model do
link_with ['DianaModels']
pod 'ReactiveCocoa', '~> 2.2'
pod 'TMCache', '~> 1.2'
pod 'SSKeychain', '~> 1.2'
pod 'Mantle', '~> 1.3'
pod 'AFNetworking', '~> 1.0'
end
target :Test do
link_with ['DianaTests']
pod 'Kiwi', '~> 2.2'
end
target :View do
link_with ['Diana']
pod 'SVPullToRefresh', '~> 0.4'
pod 'MBProgressHUD', '~> 0.7'
pod 'SWTableViewCell', '~> 0.1'
pod 'MTMigration'
pod 'Masonry'
pod 'TTTAttributedLabel'
pod 'NJKWebViewProgress'
target :ViewDebug do
link_with [
'DianaDev',
'DianaViews'
]
pod 'Reveal-iOS-SDK'
end
end
By the way, I'm using the CocoaPods plugin in the Xcode. But a lot error are output when I check the Install Docs during integration:
Error opening xar archive: /var/folders/3x/mgl299js6k13tlrspqv21n340000gn/T/Model-ReactiveCocoa.xar
Are there some wrong configurations in my CocoaPods or Build Setting in Xcode6.3? Thanks for your help!
ADDED:
Here's my Link Binary With Libraries in the Build Phases. Does the red item mean something is wrong? It looks like this is the cause.