Cocoapods - Tests don't run due to an 'early unexpected exit'-error - cocoapods

I have the following Podfile that includes a test target with a host application:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.2'
use_frameworks!
inhibit_all_warnings!
target 'AnimalHouse' do
pod 'SnapKit'
pod 'Kingfisher'
pod 'KingfisherWebP'
# RxSwift
pod 'RxSwift'
pod 'RxCocoa'
pod 'RxDataSources'
# Firebase
pod 'Firebase/Core'
pod 'Firebase/Firestore'
pod 'Firebase/Auth'
pod 'CodableFirebase'
# Crashlytics
pod 'Fabric'
pod 'Crashlytics'
target 'AnimalHouseTests' do
inherit! :search_paths
pod 'RxTest'
pod 'RxBlocking'
end
end
target 'AnimalHouseTestsHostApplication' do
end
The test target builds, but the tests don't run and I get the following error:
AnimalHouseTestsHostApplication.app (4820) encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying error: The test runner exited with code 1 before checking in.))
What exactly is the problem here?

Related

xcode pod swift and obj-c

i have a podfile
platform :ios, '11.0'
inhibit_all_warnings!
#use_frameworks!
target 'app' do
pod 'ApiAI/Core'
pod 'Crashlytics'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
pod 'GoogleSignIn'
pod 'OneSignal', '2.5.0'
pod 'Realm'
pod 'SinchRTC'
pod 'SinchVerification'
pod 'MBProgressHUD'
pod 'MGSwipeTableCell'
pod 'NYTPhotoViewer', '1.2.0'
pod 'ProgressHUD'
pod 'RCSinchService'
pod 'Reachability'
pod 'RNCryptor-objc'
pod 'SoundManager'
pod 'ATHMultiSelectionSegmentedControl'
pod "DownPicker"
end
but i have error no such module 'DownPicker', if i uncomment the line use_frameworks! he did find this module, but give the another error
how i can fix it ? is that possible ? as far as I understand, this line is responsible for the language of writing
pod 'SoundManager'
pod 'ATHMultiSelectionSegmentedControl'
pod "DownPicker"
Note that you've used double quotes around DownPicker but single quotes for every other module. Perhaps that's the problem.

Cocapods -Can't Update pod ObjectMapper to version 3.3 error [!] Unknown command: `ObjectMapper,`

I just updated to Xcode 10.1 Swift version 4.2.1 and I have several build errors of:
Invalid redeclaration of '<~'
I followed this GitHub q&A and this one that says I need to update the ObjectMapper pod to version 3.3
I didn't see the ObjectMapper inside the regular Podfile however I saw it inside the Podfile.Lock and the version is - ObjectMapper (2.2.9)
I then went to terminal and tried all of these to update to 3.3 but none of them worked:
$ pod repo update
$ pod update
$ pod update ObjectMapper
$ pod 'ObjectMapper', '~> 3.3'
$ pod 'ObjectMapper', '3.3'
In terminal I keep getting:
Why do I keep getting this error?
Here is the regular podfile:
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'MyProject' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyProject
pod 'Stripe'
pod 'AFNetworking'
pod 'Alamofire'
pod 'SwiftyJSON'
pod 'SDWebImage'
pod 'Fabric'
pod 'Crashlytics'
pod 'KeychainSwift'
pod 'IQKeyboardManagerSwift'
pod 'DLRadioButton', '~> 1.4'
pod 'GoogleInterchangeUtilities'
pod 'GoogleNetworkingUtilities'
pod 'GoogleParsingUtilities'
pod 'GoogleSymbolUtilities'
pod 'GoogleUtilities'
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/DynamicLinks'
pod 'Firebase/Storage'
pod 'Firebase/Crash'
pod 'Firebase/Messaging'
pod 'FirebaseInstanceID', '3.2.0'
pod 'GeoFire', :git => 'https://github.com/firebase/geofire-objc.git'
pod 'GooglePlacesAPI'
pod ‘GoogleMaps’
pod 'GooglePlaces'
pod 'GooglePlacePicker'
pod 'ReachabilitySwift'
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.2'
end
end
end
end
I had to remove all the pods from my project then reinstall them.
First run the below code because you have to install the cocoapods-clean plugin to run pod clean.
$ sudo gem install cocoapods-clean
Second I copied all the pods from my podfile and placed them in a temporary different file then I ran the below 3 commands to remove all the pods:
$ pod deintegrate
$ pod clean
$ rm Podfile
After it was clean using the above 3 commands I then ran pod init to create a new Podfile, opened it, and pasted the saved pods from the temporary file. I also added the below ObjectMapper pod to the Podfile:
$ pod 'ObjectMapper'
Then I ran pod install to install everything
After everything was done I ran $ vim Podfile.lock and the ObjectMapper now had a version of:
- ObjectMapper (3.4.1)

Unable to find a specification for `Alamofire (~> 3.5)`

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 'Alamofire', '~> 3.5' end
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
This is the pod file, swift 2.3, Xcode VERSION 7.3.1. I'm trying to install alamofire , but I'm getting the error above, i searched google , but there wasn't any useful things to do. any help?
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'MyProject' do
use_frameworks!
# Pods for MyProject
pod 'Alamofire', '~> 4.7'
end
Hopefully this must work. Check for your Pod version also.
First of all try make higher deployment target
if not work then
Try to run these command one by one
pod repo remove master
pod setup
pod update

How to fix error with CocoaPods?

I'm learning iOS just now.
I cloned from https://github.com/huyouare/SwiftParseChat.git
and I build it but get error.
diff: /../Podfile.lock: No such file or directory
diff: Manifest.lock: No such file or directory error:
The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.`
So I remove the workspace file and pod install.
rm -rf MyProject.xcworkspace
pod install
But I met errors.
Re-creating CocoaPods due to major version update.
Analyzing dependencies
[!] The dependency `Alamofire (~> 1.3)` is not used in any concrete target.
The dependency `APAddressBook` is not used in any concrete target.
The dependency `Bolts` is not used in any concrete target.
The dependency `JSQMessagesViewController (from `https://github.com/galambalazs/JSQMessagesViewController.git`, branch `smooth-scrolling`)` is not used in any concrete target.
The dependency `JSQSystemSoundPlayer` is not used in any concrete target.
The dependency `FBSDKCoreKit` is not used in any concrete target.
The dependency `FBSDKLoginKit` is not used in any concrete target.
The dependency `FBSDKShareKit` is not used in any concrete target.
The dependency `FBAudienceNetwork` is not used in any concrete target.
The dependency `Parse` is not used in any concrete target.
The dependency `ParseUI` is not used in any concrete target.
The dependency `ParseCrashReporting` is not used in any concrete target.
The dependency `ParseFacebookUtils` is not used in any concrete target.
[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
The Podfile is :
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘8.0’
use_frameworks!
pod 'Alamofire', '~> 1.3’
pod 'APAddressBook'
pod 'Bolts'
pod 'JSQMessagesViewController', :git => 'https://github.com/galambalazs/JSQMessagesViewController.git', :branch => 'smooth-scrolling'
pod 'JSQSystemSoundPlayer'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'FBAudienceNetwork'
pod 'Parse'
pod 'ParseUI'
pod 'ParseCrashReporting'
pod 'ParseFacebookUtils'
How can I fix this error?
You can modify the podfile like this:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'SwiftParseChat' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'Alamofire', '~> 1.3’
pod 'APAddressBook'
pod 'Bolts'
pod 'JSQMessagesViewController', :git => 'https://github.com/galambalazs/JSQMessagesViewController.git', :branch => 'smooth-scrolling'
pod 'JSQSystemSoundPlayer'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'FBAudienceNetwork'
pod 'Parse'
pod 'ParseUI'
pod 'ParseCrashReporting'
pod 'ParseFacebookUtils'
# Pods for SwiftParseChat
end
Try like this
rm Podfile
pod init
Then new Podfile is created.
Then you can insert necessary API to the new Podfile.

compilation error: cocoapods xcode test project compilation error, how to remove test project cleanly

The question is how to cleanly remove Test in cocoapods PodFile ?
I'ved just recently updated cocoapods 1.0.0 to my project
I ran "pod init" to generate a sample PodFile then put in my pods.
Whole bunch of error generated by the xcode test project ProjectNameTests
http://imgur.com/fUOF18i
How can I cleanly remove the tests ? Even if comment it out there is other problems like Bridging-Header.h cannot find dependent header.
In my current PodFile for 1.0.0:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'ProjectName' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for ProjectName
pod 'FBSDKCoreKit', '~> 4.9'
pod 'FBSDKLoginKit', '~> 4.9'
pod 'FBSDKShareKit', '~> 4.9'
pod 'SwiftyJSON', '~> 2.3.1'
pod 'Alamofire', '~> 3.0'
pod 'Google/Analytics', '~> 1.0.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'AWSS3'
target 'ProjectNameTests' do
inherit! :search_paths
# Pods for testing
end
end
my previous PodFile, no mention for target project or test:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'FBSDKCoreKit', '~> 4.9'
pod 'FBSDKLoginKit', '~> 4.9'
pod 'FBSDKShareKit', '~> 4.9'
pod 'SwiftyJSON', '~> 2.3.1'
pod 'Alamofire', '~> 3.0'
pod 'Google/Analytics', '~> 1.0.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'AWSS3'
The type of errors you'r defining are not because you have a target to the tests in your Podfile. inherit! :search_paths indicates that this target inherits the pods from the target above it.
One thing you might be getting wrong is that the "target 'ProjectName' do" is not regarding your project name but an actual target of your project.
A target can have a different name then your project.
You can also check the official migration guide Migration Guide.

Resources