I've just included the Google Analytics Pod as described in their iOS developer guide with:
pod 'Google/Analytics'
When running
pod install
it installs the following dependencies:
Installing FirebaseAnalytics (3.2.0)
Installing FirebaseInstanceID (1.0.6)
Installing Google (3.0.3)
Installing GoogleAnalytics (3.14.0)
Installing GoogleInterchangeUtilities (1.2.1)
Installing GoogleSymbolUtilities (1.1.1)
Installing GoogleUtilities (1.3.1)
Since I don't use Firebase, I would like to get rid of the FirebaseAnalytics and FirebaseInstanceID (as well as all pods that are not needed by the framework itself).
Installing unused dependencies only bloats up my app size. I would like to only install the absolute minimum amount of pods to get GoogleAnalytics running.
Any ideas on how to kick the unused Pods out?
As seen in this answer, you can use:
pod 'GoogleAnalytics'
…to avoid installing the dependencies. Note that you'll need to change your Objective-C imports in your bridging header file; I needed at least:
#import <GoogleAnalytics/GAI.h>
#import <GoogleAnalytics/GAIFields.h>
#import <GoogleAnalytics/GAIDictionaryBuilder.h>
Related
So, this question is not about how to fix something, but about how it is working this way.
I want to use FirebaseMessage in my app for push notifications, which have a dependency FirebaseCore. I started just adding FirebaseMessage to my Podfile
pod 'Firebase/Messaging'
I got installed:
Installing Firebase (5.4.1)
Installing FirebaseCore (5.0.6)
Installing FirebaseInstanceID (3.1.1)
Installing FirebaseMessaging (3.0.3)
Installing GoogleToolboxForMac (2.1.4)
Installing Protobuf (3.6.0)
Okey, problem here is that I get a warning when building the project, because FirebaseAnalytics is missing. No problem, I can add:
pod 'Firebase/Messaging'
pod 'Firebase/Core'
and get:
Installing Firebase (5.4.1)
Installing FirebaseAnalytics (5.0.1)
Installing FirebaseCore (5.0.6)
Installing FirebaseInstanceID (3.1.1)
Installing FirebaseMessaging (3.0.3)
Installing GoogleToolboxForMac (2.1.4)
Installing Protobuf (3.6.0)
Installing nanopb (0.3.8)
...and I get nanopb and FirebaseAnalytics extra.
Why is this happening? Looking at the podspecs, FirebaseCore has no dependencies related to FirebaseAnalytics:
https://github.com/CocoaPods/Specs/blob/master/Specs/8/b/d/FirebaseCore/5.0.6/FirebaseCore.podspec.json
I would like to find what tells cocoapods to install the FirebaseAnalytics pod, and why it only happens when I specifically install FirebaseCore.
Firebase/Core is the Core subspec of the Firebase pod. See details in the Firebase podspec.
While the FirebaseCore pod does not depend on FirebaseAnalytics, the Core subspec of the Firebase pod does.
It is unfortunate that "Core" is overloaded in Firebase terminology, but would tricky to change at this point without breaking a lot of apps.
I just upgraded to Swift 3 from 2.2. I'm using Firebase, Google Maps, Google Places, SwiftyJSON, Alamofire 4.4, and SDWebImage. I reinstalled all the pods, ran git commit, and fixed all the errors except this one:
ld: framework not found GoogleInterchangeUtilities clang:
error: linker command failed with exit code 1 (use -v to see
invocation)
(null): Framework not found
GoogleInterchangeUtilities
(null): Linker command failed with exit code 1 (use -v to see
invocation)
Where do I find GoogleInterchangeUtilities and how do I install or fix it?
When I upgraded from Swift 2.2 to Swift 3 the first thing I did was clean and remove my cocoapods:
pod deintegrate
pod clean
pod cache clean --all
rm Podfile
For some reason when I reinstalled all of the pods I originally had, the GoogleInterchangeUtilities file plus several others were removed in the process:
Analyzing dependencies
Removing GoogleInterchangeUtilities //**REMOVED**
Removing GoogleNetworkingUtilities //**REMOVED**
Removing GoogleParsingUtilities //**REMOVED**
Removing GoogleSymbolUtilities //**REMOVED**
Removing GoogleUtilities //**REMOVED**
Downloading dependencies
Installing Alamofire 3.5.1 (was 3.4.1)
Installing Firebase 3.15.0 (was 3.3.0)
Installing FirebaseAnalytics 3.7.0 (was 3.2.1)
Installing FirebaseAuth 3.1.1 (was 3.0.3)
Installing FirebaseCore (3.5.2)
Installing FirebaseCrash 1.1.6 (was 1.0.6)
Installing FirebaseDatabase 3.1.2 (was 3.0.2)
Installing FirebaseDynamicLinks 1.3.4 (was 1.1.0)
Installing FirebaseInstanceID 1.0.9 (was 1.0.7)
Installing FirebaseStorage 1.1.0 (was 1.0.2)
Installing GTMSessionFetcher (1.1.9)
Installing GoogleMaps 2.2.0 (was 1.13.2)
Using GooglePlacesAPI (1.0.6)
Installing GoogleToolboxForMac (2.1.1)
Installing ObjectMapper 1.5.0 (was 1.3.0)
Installing Protobuf (3.2.0)
Using SDWebImage (3.8.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 10 dependencies from the Podfile and 17 total pods installed.
I eventually went to Google and typed in GoogleInterchangeUtilities which led me to it's pod install page here. I reinstalled the pod which removed the error but then each of the other files that were removed resulted in their own ld: framework not found... Xcode errors.
Long story short if you cleaned and removed your cocoapods file and reinstalled everything, there's a possibility the Google...Utilities frameworks will get removed. You have to include those specific individual pods back in your pod file and run: pod install again.
Here is my pod file with them included in addition to all my other pods:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.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 'GoogleInterchangeUtilities', '~> 1.2'
pod 'GoogleNetworkingUtilities', '~> 1.2'
pod 'GoogleParsingUtilities', '~> 1.1'
pod 'GoogleSymbolUtilities', '~> 1.1'
pod 'GoogleUtilities', '~> 1.3'
//all my other pods...
Here are their cocoapods install pages:
GoogleInterchangeUtilities
GoogleNetworkingUtilities
GoogleParsingUtilities
GoogleSymbolUtilities
GoogleUtilities
I am getting EXC_BAD_ACCESS after including 'Firebase/Auth' in Podfile. This happens without adding any line of firebase code. I am using swift3 on xcode 8 and the resultant pods are -
Installing Firebase (3.8.0)
Installing FirebaseAnalytics (3.5.1)
Installing FirebaseAuth (3.0.6)
Installing FirebaseCore (3.4.4)
Installing FirebaseInstanceID (1.0.8)
Using GTMOAuth2 (1.1.4)
Using GTMSessionFetcher (1.1.7)
Using GoogleAppUtilities (1.1.2)
Installing GoogleInterchangeUtilities (1.2.2)
Using GoogleSignIn (4.0.1)
Using GoogleSymbolUtilities (1.1.2)
Installing GoogleToolboxForMac 2.1.0 (was 2.1.0)
Using Localize-Swift (1.6)
Using ProtocolBuffers-Swift (3.0.6)
Using QorumLogs (0.9)
The error comes in Thread 1 in [UIViewController(FIRAScreenClassName) fira_viewDidAppear:]:
This happens only if the pod target is itself a framework which is embedded in an app eventually.
I do have Google analytics as well. Is it because ARC is not enabled? How do I do that on xcode-8?
Any other options to try?
There appears to be a problem in the latest Firebase/Core (3.8.0) release. Even #IBDesignable was crashing with a recursive call to the method signature you mentioned.
You have a couple of options:
In Info.plist (app), set FirebaseAutomaticScreenReportingEnabled to NO (bool). This solved the problem for my running application, but IBDesignable resources caused this error on build:
file:///path/to/project/Base.lproj/Main.storyboard: error: IB Designables: Failed to render and update auto layout status for UIViewController (svZ-78-1Mn): The agent crashed
You may want to temporarily downgrade to 3.7.1, for example,
pod 'Firebase/Core', '~> 3.7.1'
pod 'Firebase/Auth'
pod 'Firebase/Database'
The rest of the dependencies should take care of themselves when you run pod update.
I made a silly mistake. Never turned on Google under Authentication -> Sign in methods on Firebase
I am suspecting that the Podfile is not correct. I got into similar problem by adding Firebase dependency into a framework and I ran into the problem like this
objc[12345]: Class FIRAAppEnvironmentUtil is implemented in both
/Users/...Build/Products/Debug-iphonesimulator/SomeFramework.framework/SomeFramework
(0x105ef7fc8) and /Users/.../CurrentProject.app/CurrentProject
(0x105945108). One of the two will be used. Which one is undefined.
As mentioned in this post, you might have duplicate dependencies in different targets which could lead to weird bug like this. Adding Firebase pod into the main target and removing the Firebase pod from the framework fixed the problem for me.
In Pod it is showing like this.
libGTM_NSData+zlib_external.a
While in Build settings, it looks as below
$(PODS_ROOT)/GoogleUtilities/Libraries/libGTM_NSData+zlib.a
In config, it shows as this.
-force_load $(PODS_ROOT)/GoogleUtilities/Libraries/libGTM_NSData+zlib_external.a
How can I remove error of not finding libGTM_NSData+zlib.a as I know new google library has libGTM_NSData+zlib_external.a only.
I am using
pod 'Google/Analytics'
pod 'Google/SignIn'
in my Pod file.
Kindly give proper structure of removing such issue. I tried to rename and keeping all of same name as _external, it didn't solve the problem.
Final installation of Pods via Terminal shows Log as below
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (2.6.3)
Installing AMScrollingNavbar (1.5.1)
Installing Bolts (1.7.0)
Installing ChartboostSDK (6.4.0)
Installing Charts (2.2.4)
Installing Crashlytics (3.7.0)
Installing Fabric (1.6.7)
Installing Google (2.0.3)
Installing Google-Mobile-Ads-SDK (7.7.1)
Installing GoogleAnalytics (3.14.0)
Installing GoogleAppUtilities (1.1.0)
Installing GoogleAuthUtilities (2.0.0)
Installing GoogleInterchangeUtilities (1.2.0)
Installing GoogleNetworkingUtilities (1.2.0)
Installing GoogleSignIn (3.0.0)
Installing GoogleSymbolUtilities (1.1.0)
Installing GoogleUtilities (1.2.0)
Installing MMDrawerController (0.5.7)
Installing Optimizely-iOS-SDK (1.4.2)
Installing Parse (1.13.0)
Installing SDWebImage (3.7.5)
Installing Shapes (1.0.2)
Installing SocketRocket (0.3.1-beta2)
Installing libPusher (1.5)
Installing pop (1.0.9)
Generating Pods project
Integrating client project
Thanks.
I had the same issue today, removing the pod cache and reinstalling from scratch did the trick for me.
close Xcode, delete pod files, then
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod install
Open Build Settings
Go to Framework Search Paths
Leave only these two as shown in image, and remove all others, like libGTM_NSData+zlib.a or any other.
This inherited & Project Directory will cause automatically detection from Pods, and it will not more create problem for you.
pod 'Google/Analytics', '~> 2.0'
Fixed this for Google Analytics
My podfile has:
# 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 'CoChat' do
pod 'Firebase', '>= 2.5.0'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'
pod 'AFNetworking', '~> 3.0'
#pod 'MobileDeepLinking-iOS'
end
I run pod install and get:
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Using AFNetworking (3.0.4)
Using Bolts (1.6.0)
Using FBSDKCoreKit (4.10.0)
Using FBSDKLoginKit (4.10.0)
Using FBSDKShareKit (4.10.0)
Using Firebase (2.5.1)
Installing FirebaseUI (0.3.2)
Installing Google (1.3.2)
Installing GoogleAppUtilities (1.0.0)
Installing GoogleAuthUtilities (1.0.1)
Installing GoogleInterchangeUtilities (1.1.0)
Installing GoogleNetworkingUtilities (1.0.0)
Installing GoogleSignIn (2.4.0)
Installing GoogleSymbolUtilities (1.0.3)
Installing GoogleUtilities (1.1.0)
[!] The 'Pods-CoChat' target has transitive dependencies that include static binaries: (/Users/Nathan/Library/Mobile Documents/com~apple~CloudDocs/Desktop/CoChat/Pods/Google/Libraries/libGGLCore.a and /Users/Nathan/Library/Mobile Documents/com~apple~CloudDocs/Desktop/CoChat/Pods/Google/Libraries/libGGLSignIn.a)
When you open the XCWorkspace, nothing has changed. The FirebaseUI pod/framework is not there. Not a clue why this isn't installing.
I'm facing the same problem. The problem is with FirebaseUI/Auth and Google Sign in.
Solution
comment out use_frameworks!
Use bridging headers files by creating
a cocoa touch file, remember to check the box for 'Create a bridging
header file' and then after creation only deleting the .m .h files
as you want the bridging header file. Manually call out the headers
files from there.
If you read the posts on https://github.com/firebase/FirebaseUI-iOS/issues?q=is%3Aissue+is%3Aclosed, some seem to have similar issue. One possible fix is to get the 0.2.6 version of FirebaseUI by including '~>0.2.6' beside the firebaseUI pod
Hope this helps and hopefully this bug is fixed.