Unable to install AFNetworking and Google-Maps-iOS-Utils together - cocoapods

I need to use Afnetworking and google-maps-ios-utils both in my project but using pods it is not possible. because Afnetworking don't work if I comment # use framework! in my pod file and google-maps-ios-utils don't work if I uncomment it.
I tried manually installing google-maps-ios-utils but it still give me error related to bridging header.
Is there any way to use both library together.
Or how to install AFnetworking or google-maps-ios-utils manually to avoid this clash.
I need some alternative for google-maps-ios-utils because it is only works if I comment #use_frameworks! in pod file , and if I comment it most of other library such as FBSDKLoginKit and SDWebimage get error.
Xcode 10, swift 4.

Have you try this on your pod file like below,
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
def share_pods
# Pods for your target name
pod 'AFNetworking', '~> 3.0'
pod 'GoogleMaps'
end
target 'your target name' do
share_pods
end
Hope it's help you:)

Related

Adding Mongodb to ios project

I am currently adding monogodb to my ios project. Just after following the instruction stitch mongodb offered, I am stuck at when pod installing StitchCoreSDK. It supposed to create a xcworkspace file, but it didn't. Instead, I got the following message.
enter image description here
The podfile I create is like following
# Uncomment the next line to define a global platform for your project
platform :ios, '11.4'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'paotuaniOS' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
# Pods for paotuaniOS
pod 'Nexmo-Stitch'
pod 'StitchSDK', '~> 4.0.5'
target 'paotuaniOSTests' do
inherit! :search_paths
# Pods for testing
end
target 'paotuaniOSUITests' do
inherit! :search_paths
# Pods for testing
end
end
Can any one help me with this issue?
Thanks!!!
I had this issue before. The repo had problems. The repo has been updated. Please use
pod 'StitchSDK', '~> 4.1.1'

Trying to Rebuild a Legacy IOS App, Getting Error in Facebook-IOS-SDK Cocoapod

I've been asked to rebuild an existing IOS app that uses Facebook-IOS-SDK. The app is at least 5 years old so I expected things to be deprecated. I have some limited experience with XCode and IOS but I'm far from an expert. I've never used cocapods until today. I installed cocoapods and ran pod init. Facebook-IOS-SDK ver 3.24.4 loaded with no errors (other pods too, including Bolt, with no errors).
I've read the migration notes on the FB dev page regarding the versions and it's implied that I should be able to use 3.24. When I do a clean build I get the error:
(FBRequest *)requestForUpdateOpenGraphObject(id<FBOpenGraphObject>)object
{
return [FBRequest requestForUpdateOpenGraphObjectWithId:object[#"id"] graphObject:object];
}
Expected method to read dictionary element not found on object of type 'id<FBOpenGraphObject>'
This error is in FBRequest.m, the cocoapod code, not in my clients code. This code is marked read only. If this is the correct pod version, and I can't change it then is there some other dependency in the (large) project that needs to be updated?
Podfile:
# Uncomment this line to define a global platform for your project
platform :ios, "9.0"
target "tbd" do
pod 'IQKeyboardManager'
pod 'UICKeyChainStore'
pod 'CocoaLumberjack', '~> 2.0.0-beta'
pod 'SDURLCache'
pod 'HockeySDK'
pod 'Facebook-iOS-SDK', '~> 3.23'
pod 'GoogleAnalytics-iOS-SDK'
pod 'UIActionSheet-Blocks', '~> 1.0'
end
target "tbdTests" do
end
The only, nasty, solution I found is to change the code inside FBRequest.m manually.
Change line 370 from:
return [FBRequest requestForUpdateOpenGraphObjectWithId:object[#"id"] graphObject:object];
to
return [FBRequest requestForUpdateOpenGraphObjectWithId:object.objectID graphObject:object];
this should make you project runs again.
Again, this is not a nice solution, but it works :)
Emilio
if you don't have the need to use Facebook-IOS-SDK ver 3.24.4 you can simply use the latest version 4.36.0.
have a look at your Podfile and see if there is any reference to Facebook-IOS-SDK, if there is something like:
pod 'Facebook-IOS-SDK', '~> 3.0'
you can replace it with:
pod 'Facebook-IOS-SDK', '~> 4.0'
otherwise post your Podfile and we can have a look.
Cheers

How do I use source in podfile?

I'm new to ios development. For some reason I need to manually set podfile for my Cordova app. There are GoogleCloudMessaging and GGLInstanceID in my podfile, now I want to install a brightcove video player library, the source is https://github.com/brightcove/BrightcoveSpecs.git. However when I add the source on the top of podfile, it seems cocoapods also try to install GoogleCloudMessaging from that source.
My podfile:
source 'https://github.com/brightcove/BrightcoveSpecs.git'
use_frameworks!
platform :ios, '8.0'
target 'myapp' do
pod 'Brightcove-Player-Core/dynamic'
pod 'GoogleCloudMessaging'
pod 'GGLInstanceID'
end
Error:
Analyzing dependencies
[!] Unable to find a specification for `GoogleCloudMessaging`
You need to include the official CocoaPods source:
https://github.com/CocoaPods/Specs.git
Docs:
The official CocoaPods source is implicit. Once you specify another source, then it will need to be included.
So your file should work like this I believe:
source 'https://github.com/brightcove/BrightcoveSpecs.git'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
platform :ios, '8.0'
target 'myapp' do
pod 'Brightcove-Player-Core/dynamic'
pod 'GoogleCloudMessaging'
pod 'GGLInstanceID'
end
Try by giving like:
pod "Brightcove-Player-FreeWheel", :git => 'https://github.com/brightcove/BrightcoveSpecs.git'

"No such module 'Firebase'" when add Firebase into a library

I just created new Framework and added Firebase via CocoaPods, when combine the library it success.
But when I add that library to other project via CocoaPods as well, then combine that project, and it raise an error: No such module 'Firebase'
Anyone faced a problem like this?
You need to add the follwing to your POD file:
pod 'Firebase'
After that, you need to type in your terminal
pod install (to refresh the pod file)
I solve my problem using just the specific import that I'm using, for example.
In my SDK I'm using FirebaseCore and FirebaseAnalytics.
Into my class I just import:
import FirebaseCore
import FirebaseAnalytics
And in my .podspec I needed to set static_framework property to true, so my .podspec it's seems like code below:
s.static_framework = true
s.dependency 'Firebase'
s.dependency 'Firebase/Core'
It works for me!
Do you open the workspace file after installed with cocoa pods ?
Check if the library is added in "Linked Frameworks" or "Embedded Binaries"
If it didn't work, add this pod file
platform :ios, '8.0' use_frameworks! target ‘Your Project’ do
pod 'Firebase', '>= 2.5.1'
pod ‘Firebase/Auth’
pod ‘Google/SignIn’
pod ‘Firebase/Database’
pod 'Firebase/Storage' end
and then type pod deintegrate and after that run pod install.
tried all these..
I was stuck in this situation for more than 2weeks.
finally resolved by adding "excluded architectures = arm64"
this is the easiest solution nowadays
Everything was setup fine and was working before but..
My Problem:
What's was wrong with me?
I was using older name of pod, eg. - pod 'Firebase/Analytics', pod 'Firebase/Crashlytics'
New pod names are pod 'FirebaseAnalytics', pod 'FirebaseCrashlytics' (Problem with / )
Solution:
Use new pod name to integrate pod 'FirebaseAnalytics', pod 'FirebaseCrashlytics' (Install pod with new pod name)
Import import FirebaseCore, import FirebaseAnalytics instead just import Firebase
import FirebaseAnalytics - I'm using for log events
Hi today i fix same problem
1 : open podfile from xcode than add " pod 'Firebase' "
save and close it
2 : open vscode or any editor using, open new terminal than write " cd ios " to open ios file than " pod install " when you install it showing problem need to add search path
so now open ios file from xcode and go to : runner > target runner > build settings > all > search paths
and add this " $(inherited) " into framework search path and header search path
that's all
For me I had to change the version specified in the Podfile as it was above what my app supported. Specifically in the Podfile I changed: 'platform :ios, '11.0' to platform :ios, '10.0' which corresponds with Deployment Info in the General Tab for my app I'm working on.
For Flutter folks adding Firebase to their apps, make sure you follow the steps in Add Firebase to your iOS Project as well as those in the SDK setup steps in the Firebase Console:
In summary:
Run pod init if you don't have a pod file
Add the necessary pods to the bottom of the podfile. All possible Firebase pods can be found here.
pod 'Firebase/Analytics'
pod 'Firebase/Firestore'
pod 'Firebase/Auth'
pod 'Firebase/Storage'
Run pod install
This issue can be caused by incorrectly set-up schemes:
If you have multiple schemes (e.g. 'Dev', 'QA', 'Production' etc.) in your project, check you have the build configurations set correctly.
Further guidance in this answer here:
https://stackoverflow.com/a/65453578/12322900
Then run pod deintegrate and pod install and make sure you're using the .xcworkspace file.
My failure was that I downloaded modules to
target 'YourProjectUITests' do
# Pods for testing
pod 'FirebaseCore'
And the right one is
# Pods for YourProject
pod 'FirebaseCore'
(Without UITests)
It is because you don't have added pod dependency in Podfile.
you will find below line in Podfile
Uncomment this line to define a global platform for your project
#platform :ios, '9.0'
follow the below steps.
1)just remove the # .so it will be like.
platform :ios, '9.0'
2)add the below dependencies.(Do not add all ,you just need to add whatever used in you app ,if you have used Firebase/Core only then add that line only)
#Pods for app name
pod 'Firebase'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
3)clean the build
flutter clean
4)run Command :
flutter run (It will automatically adds a required pods).
that's it.
The same thing happened to me last week. I solved it by:
1. pod deintegrate
2. Open Xcode and delete any instance of pod.
3. pod install

Can't add Alamofire to project with cocoapods

I'm trying add Alamofire to my project using Cocoapods, doing the same thing in the quick start, changing pods file, but still can't import Alamofire.
Is there something that I must more to do?
In order to use CocoaPods written in Swift, you must explicitly include use_frameworks! in your Podfile to opt into using frameworks. Like this:
platform :ios, "8.0"
use_frameworks!
pod 'Alamofire', '2.0'
Without including this you’ll get an error when you try to install the pods like Alamofire.

Resources