-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not compatible with cocoapods use_frameworks! #3
Comments
+1 |
Ref: segmentio/analytics-ios#493 It's impossible to use this library with SWIFT and Segment-GoogleAnalytics because the Segment-GoogleAnalytics pod fails to install with this error when you have use_frameworks! set: [!] The 'Pods-Eyegroove' target has transitive dependencies that include static binaries: (/Users/snibbe/dev/apps/eyegroove-ios-3.0/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a and /Users/snibbe/dev/apps/eyegroove-ios-3.0/Pods/GoogleIDFASupport/Libraries/libAdIdAccessLibrary.a) This seems to be a known error with static dependencies and SWIFT/Podfiles: CocoaPods/CocoaPods#3194 |
Not if you patch your cocoapod implementation to avoid checking for it: #!/bin/bash
file=`gem which cocoapods/installer`
sed 's/def verify_no_static_framework_transitive_dependencies/&~ return/; y/~/\n/' $file > sed_temp_file
sudo mv sed_temp_file $file Not saying that's a good way to solve it .. but it's definitely a workaround until it gets fixed. |
Hi,
|
Did you add the post_install hook to your Podfile? |
Yes, there's still a compile-time error in SEGGoogleAnalyticsIntegration.h:
due to |
Are you using the latest pod Analytics v3.0.2? |
Yes we are using 3.0.2! Thanks for your help. |
Are you guys using the AnalyticsSwift from segment or just the Segment-GoogleAnalytics pod? |
Segment-GoogleAnalytics.
|
Gotcha, thanks! |
So I am trying to solve this problem but am still missing something.
So now I don't get any errors installing I am still quite new to this, what am I missing ? :) |
@Katafalkas not sure if that's the same problem I had .. but I had to patch |
I am having a similar issue, @rokgregoric fix doesn't solve this issue. The Podfile looks like this (with workspace and xcodeproj names removed)
|
@dmorrow try using: |
@rokgregoric Thanks for the suggestion, but I get the same error:
|
You need to patch cocoapods. Follow the instructions above. |
Still seeing the exact same error as @dmorrow here, with the patch above. |
@lukecharman #!/bin/bash
file=`gem which cocoapods/installer`
sed 's/def verify_no_static_framework_transitive_dependencies/&~ return/; y/~/\n/' $file > sed_temp_file
sudo mv sed_temp_file $file you can do it manually as well .. just comment out |
Alright, thank you, I'll give that a try! |
Ok, to sum it up:
Thanks, @rokgregoric, you saved me hours of time.
EDIT2: For cocoapods v1.0.0.beta3 you can use |
@glyuck you are welcome. |
When I try to run 'bundle install' I get the following error:
|
@dougbankspersonal updated my comment to use HTTPS URLs instead or SSH: |
Any updates here on final resolution? The workarounds work but definitely not the best situation. |
Hi Nathan, Looking into it today - I will update you all as soon as I have more! |
There is still no resolution (other than the workarounds posted here) until either CocoaPods relaxes restriction on having a transitive dependency that is a static library (CocoaPods/CocoaPods#3194 (comment)), or GA ships a dynamic framework. |
To clarify, this only affects you if you are using
You can also try asking CocoaPods to relax their requirement, or ask Google to ship a dynamic framework. If there are any suggestions as to how we can ship a solution in our library, please send a PR or open a new issue to discuss the approach, thanks! |
Also another solution (by the way of orta/ARAnalytics#218 (comment)) would be to copy the integration code (these files) manually into your project. Then depend on Google Analytics directly. Instead of importing the integration from our library, then you would import the integration from your local copy. This eliminates the transitive dependency (from App -> Segment-GoogleAnalytics -> GA to App -> GA). |
Just in case this helps anyone, here is what seems to work for me, and doesn't require changing anything outside of the Podfile: Podfile:
|
can @segment-integrations/mobile add working solutions to the Google Analytics docs? 🙏 |
+1 to adding the solution @joenoon posted to the docs, would save future people hours :) |
Not sure if this is related, but just installed Cocoapods 1.0.0 and now getting |
@joenoon We are using your solution, but get a crash when tracking starts in the app - |
@dmorrow I'm not crashing with:
So I'm not sure what it could be :/ |
@joenoon I think we exposed a multithreading bug in GAI. You are correct, I can call |
@joenoon , i did this but it's give me duplicate symbol error ., even there is nothing like that |
Hi all, I've added our supported work around to our docs: I would suggest follow this for now as we have tested it and can confirm/support that this works. Let me know if you have any questions! |
It looks like the workaround is going to be forever. |
As of #14, you can use:
|
There is a problem with the current integration when using
use_frameworks!
.All the needed parameters (search paths, linker flags) are set to the main project (added to the
Pods.conf.xcconfig
) instead of being set inSegment-GoogleAnalytics.xcconfig
I hope this gets fixed soon .. in the meantime I am using a quick fix at the end of my
Podfile
:The text was updated successfully, but these errors were encountered: