rxz99 / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

use_frameworks! in Cocoapods #609

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
---------------------------------------------------------------------------
NOTE: This issue tracking system is for Google Analytics developer products
only.
If you are not a developer/programmer visit:
http://www.google.com/analytics/support.html
---------------------------------------------------------------------------
Name of related component: Mobile Tracking

Request summary:
Please may the Google Analytics pod be updated to work with the new 
use_frameworks! option in cocoapods

Use Cases:
A number of other components will only work in Frameworks mode (such as 
features that use IB Designables)

At the moment if I switch to using frameworks the GAI.h file can't be found

Original issue reported on code.google.com by adrian.s...@radiowaves.co.uk on 13 Apr 2015 at 3:39

GoogleCodeExporter commented 8 years ago
Any updates on getting Google Analytics 3 working with use_frameworks! on Swift 
projects?

Original comment by en...@wearehathway.com on 18 May 2015 at 5:15

GoogleCodeExporter commented 8 years ago
a number of us have to use_frameworks! in our podfile because all the other 
libraries we are using require this.  Therefore we either need use_frameworks! 
for Google Analytics or please provide a workaround for this issue in the 
interim.

Original comment by LH.qa.t...@gmail.com on 3 Jun 2015 at 3:44

GoogleCodeExporter commented 8 years ago
actually even trying to install Google Analytics in a project using 
use_frameworks! fails with this error:
[!] The 'Pods' target has transitive dependencies that include static binaries:

Original comment by LH.qa.t...@gmail.com on 3 Jun 2015 at 4:07

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
did you guys seriously make cocoapods required for google services without 
fixing this issue??well played

Original comment by ardaer...@gmail.com on 24 Jun 2015 at 8:53

GoogleCodeExporter commented 8 years ago
This bug makes library unusable for me.. 

Original comment by diej...@gmail.com on 26 Jun 2015 at 2:04

GoogleCodeExporter commented 8 years ago
Same here. I've had to comment all of the the GA code out of my app.

Original comment by julian.p...@osaaru.com on 26 Jun 2015 at 2:07

GoogleCodeExporter commented 8 years ago
Same issue here. I can't use analytics on my app due to this issue.

Original comment by bitom...@gmail.com on 9 Jul 2015 at 12:36

GoogleCodeExporter commented 8 years ago
Can we download the SDK and add it to the project in the old way? It's a shame 
we can't use Analytics in Swift projects....

Original comment by lucasl...@gmail.com on 9 Jul 2015 at 12:47

GoogleCodeExporter commented 8 years ago
Yes, you can. It's an inconvenience, but you can use Analytics in Swift. 

Original comment by marcsl...@gmail.com on 9 Jul 2015 at 4:46

GoogleCodeExporter commented 8 years ago
How do I add the sdk to my swift project?

Original comment by bitom...@gmail.com on 9 Jul 2015 at 5:08

GoogleCodeExporter commented 8 years ago
+1 the priority on this issue should be raised to high.  Really silly to say 
you support CocoaPods and Swift but not use this - GA is unusable through 
CocoaPods for most folks without this.

Original comment by ana...@gmail.com on 16 Jul 2015 at 5:58

GoogleCodeExporter commented 8 years ago
Hey, all. Thanks for reporting this issue. I have spoken with the team that's 
working on our CocoaPod support. They are aware of the problem and it's 
something they're actively looking into. However, my understanding is that it's 
not a trivial fix, so I don't have any sort of definitive timeline for you. 
I'll report back on this bug when I have any more details that I can share.

In the meantime, you can add Google Analytics the old fashioned way without 
CocoaPods, although it's certainly not as convenient, I agree. :)

In any case please continue to Star this bug so the team knows it's important. 
Thanks for your patience!

Original comment by k...@google.com on 16 Jul 2015 at 6:51

GoogleCodeExporter commented 8 years ago
Hi,

can you please point me to a resource which explains how to install and use the 
sdk in a swift project without cocoapods. Thank you!

Original comment by reinhold...@gmail.com on 20 Jul 2015 at 8:13

GoogleCodeExporter commented 8 years ago
I think I've managed to get it to work by sort of following the steps in this 
blog post: http://flyingspheres.blogspot.com/2014/12/swift-google-analytics.html

and was able to download the necessary files for the SDK from: 
https://developers.google.com/analytics/devguides/collection/ios/v3/sdk-download

Original comment by j...@getdartapp.com on 20 Jul 2015 at 3:34

GoogleCodeExporter commented 8 years ago
For us, GoogleAnalytics is being used by another pod, 'Analytics' by Segmentio. 
 We set 'use_frameworks'.

Trying to install with cocoa pods 0.38.2 results in: 
"The 'Pods' target has transitive dependencies that include static binaries: 
(/Users/DanCraft/Documents/Projects/TLDR/Pods/GoogleAnalytics/Libraries/libGoogl
eAnalytics.a and 
/Users/DanCraft/Documents/Projects/TLDR/Pods/GoogleIDFASupport/Libraries/libAdId
AccessLibrary.a)"

Any suggestions for how to work around this?  I'm not even sure forking every 
intervening pod would work.  Thanks.  --Dan

Original comment by PlayfulG...@gmail.com on 28 Jul 2015 at 5:40

GoogleCodeExporter commented 8 years ago
Dan, you will not be able t0 use Analytics-Segmentio with 'use_frameworks' if 
it uses GoogleAnalytics. You will either have to stop using 'use_frameworks', 
or include Analytics-Segmentio by an alternative method that doesn't involve 
CocoaPods.

Original comment by marti...@batangamedia.com on 28 Jul 2015 at 6:50

GoogleCodeExporter commented 8 years ago
Hey, all. So the team is telling me that as of CocoaPods 0.38.1, this should be 
working again -- the tl;dr is that CocoaPods changed how it analyzes 
dependencies so that dependency trees of pods that are all static libraries can 
be linked into the final Swift app.

That said, I'm not sure why Dan's still having trouble. So I'm not quite ready 
to mark this as fixed yet...

Original comment by k...@google.com on 31 Jul 2015 at 2:21

GoogleCodeExporter commented 8 years ago
after updating 38.2 and trying google analytics once again, I got this error:

dyld: Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit
  Referenced from: /private/var/mobile/Containers/Bundle/Application/B0620FBC-2D8D-4627-838C-F40224FB5141/XXX.app/XXX
  Reason: Incompatible library version: XXX requires version 4.0.0 or later, but FBSDKCoreKit provides version 1.0.0

Original comment by ardaer...@gmail.com on 1 Aug 2015 at 1:03

GoogleCodeExporter commented 8 years ago
That sounds like an issue with the FBSDKCoreKit cocoapod, #19, not with the 
Google Analytics cocoapod.

Original comment by marcsl...@gmail.com on 1 Aug 2015 at 5:09

GoogleCodeExporter commented 8 years ago
Hi, we're still getting same error. Was this issue somehow resolved? We're 
using Segmentio as well, same as Dan.

Original comment by pase...@gmail.com on 30 Aug 2015 at 9:17

GoogleCodeExporter commented 8 years ago
Any insights on this one?

As of today, cocoapods 0.38.2 & use_frameworks! still doesn't allow to use 
Analytics in Swift iOS projects. 

Original comment by app.bam...@gmail.com on 20 Sep 2015 at 12:15

GoogleCodeExporter commented 8 years ago
I'm using Google Analytics on my swift project via CocoaPods.

I got it working under the following conditions:
pod --version: 0.39.0.beta.4
use_frameworks!
platform :ios, '8.0' 
pod 'Google/Analytics', '~> 1.0.0'

All my ga verbose logs looking fine.

Original comment by felipe.a...@gmail.com on 20 Sep 2015 at 12:25

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
@felipe: what import do you use in you app delegate?

Original comment by app.bam...@gmail.com on 20 Sep 2015 at 1:06

GoogleCodeExporter commented 8 years ago
@app: I'm importing GA (#import <Google/Analytics.h>) in the Bridge Header File 
only. 

Original comment by felipe.a...@gmail.com on 20 Sep 2015 at 1:24

GoogleCodeExporter commented 8 years ago
I also got it working using pod --version: 0.39.0.beta.4

Original comment by TollAppD...@gmail.com on 21 Sep 2015 at 8:10

GoogleCodeExporter commented 8 years ago
I was able to get it working in 0.38.2. This is what my Podfile looks like:

platform :ios, '8.0'
use_frameworks!

target 'JSONMaster' do
    pod 'Google/Analytics'
    pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
end

And, like felipe, I'm only importing GA in my Bridging-Header.h file.

Original comment by k...@google.com on 23 Sep 2015 at 12:18

GoogleCodeExporter commented 8 years ago
So for those of you who doesn't want the Bridging Header you can simply do what 
previous comment wrote, and then import the GoogleAnalytics library in the 
swift-files. Simply like this:

import Google

Hope this helps.

Original comment by Christop...@gmail.com on 20 Oct 2015 at 8:57

GoogleCodeExporter commented 8 years ago
I'm still seeing this problem on cocoapods 0.39.0

I'm also including GA through the segment.io "Analytics" pod.

Original comment by ak...@edx.org on 23 Oct 2015 at 2:53

GoogleCodeExporter commented 8 years ago
+1 - I'm having this problem with cocoapods 0.39.0 using the segment Analytics 
pod.

Original comment by michael....@gmail.com on 27 Oct 2015 at 5:33

GoogleCodeExporter commented 8 years ago
As of today, It is still impossible to import GA in a swift project, the usual 
way (framework).
By "Usual way", I mean:
   * pod 'Google/Analytics', '~> 1.0.0' in pod file
   * use_frameworks! in podfile
   * import Google directly in a swift file
   * no bridging header

Original comment by app.bam...@gmail.com on 28 Oct 2015 at 12:16

GoogleCodeExporter commented 8 years ago
#32: No, it's not impossible. I got it to work without a bridging header. My 
podfile:

source 'https://github.com/CocoaPods/Specs.git'

use_frameworks!
platform :ios, '8.0'

target 'myProject' do

pod 'Google/Analytics'

end

target 'myProjectTests' do

end

And then in my swift-file I simply do:
import Google

func myFunc(screenName: String) {
            let tracker = GAI.sharedInstance().defaultTracker
            tracker.set(kGAIScreenName, value: screenName)

            let builder = GAIDictionaryBuilder.createScreenView()
            tracker.send(builder.build() as [NSObject : AnyObject])
}

Notice that it has to be Google/Analytics in the podfile, and NOT pod 
'Google/Analytics', '~> 1.0.0'. 

Original comment by Christop...@gmail.com on 28 Oct 2015 at 1:27

GoogleCodeExporter commented 8 years ago
#33 Thanks, removing '~> 1.0.0' in the Podfile fixed the problem.
A new one happens now, in link phase, there is no Bitcode support in GA.
I can disable Bitocode in the whole project, but it doesn't seem a good 
practice with iOS9*.
Is there a roadmap for that support?
Just a comment (off topic), thanks for your help.

Original comment by app.bam...@gmail.com on 28 Oct 2015 at 1:59

GoogleCodeExporter commented 8 years ago
#34

Hi, no problem! :) I was struggling with the same issue for days. And regarding 
the bitcode thingy, I had the same issue and was forced to disable Bitcode in 
the entire project, and as far as I can remember it was because Google 
Analytics simply doesn't support it. I didn't find a workaround. 

Please let me know here if you find one though, cheers!

Original comment by Christop...@gmail.com on 28 Oct 2015 at 2:02

GoogleCodeExporter commented 8 years ago
Bitcode support is included in 3.14 - it's just not made its way into Cocoapods 
yet: https://code.google.com/p/analytics-issues/issues/detail?id=671

Original comment by nathan.r...@gmail.com on 28 Oct 2015 at 2:05

GoogleCodeExporter commented 8 years ago
This issue is blocking us from integrating Google Analytics into our app via 
Segment. There's a thread here: 
https://github.com/segment-integrations/analytics-ios-integration-google-analyti
cs/issues/3#issuecomment-164874798. Please give it some attention!

Original comment by sc...@snibbe.com on 15 Dec 2015 at 8:15