AppsFlyerSDK / segment-appsflyer-ios

The AppsFlyer iOS SDK integration with Segment
https://segment.com/docs/integrations/appsflyer/
MIT License
23 stars 59 forks source link

pod install: "target has transitive dependencies that include static binaries" #3

Closed ldiqual closed 8 years ago

ldiqual commented 8 years ago

When trying to add

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks! # Because of swift
pod 'segment-appsflyer-ios', '1.1.1'

and running pod install, I get the following error:

[!] The '<mytarget>' target has transitive dependencies that include static binaries: (/path/to/pods/AppsFlyerFramework/AppsFlyer.framework)

which seems to be due to this: https://github.com/CocoaPods/CocoaPods/issues/2926

I was able to workaround the error by adding this to my Podfile:

pre_install do |installer|
    # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
    def installer.verify_no_static_framework_transitive_dependencies; end
end

However after the workaround I get this new error when compiling:

#import <AppsFlyer/AppsFlyer.h> // /path/to/pods/segment-appsflyer-ios/segment-appsflyer-ios/Classes/SEGAppsFlyerIntegration.h:11:9: 'AppsFlyer/AppsFlyer.h' file not found

I'm using cocoapods 1.0.1 and targeting iOS 9 only.

Any workaround?

BrendaAF commented 8 years ago

The current work around is to copy the source code for the integration into the app manually. It looks like Segment users have run into a similar issue previously with other partners. Here is documentation from Segment for this workaround.

ldiqual commented 8 years ago

@BrendaAF Unfortunately this is not something we're ready to do. It makes dependency version tracking + update really hard, in addition to polluting the app's project with numerous compiler flags and subdependencies. I believe that the ideal way to fix it is to provide an AppsFlyer framework without static binaries, and if I understand this correctly it would require AppsFlyer to provide an open-source version of the framework. Is it something that's in your pipeline?

What would be required on our end to integrate AppsFlyer without segment? Assuming we need tracking and ad attribution.

BrendaAF commented 8 years ago

@ldiqual Here is the documentation around how to integrate AppsFlyer's native SDK.

golts commented 8 years ago

Fixed, released a new pod 1.1.4

f2prateek commented 8 years ago

@ldiqual I just saw your comment and wanted to chime in https://github.com/AppsFlyerSDK/segment-appsflyer-ios/issues/3#issuecomment-244176513.

I'm not totally sure why you think copying the integration code update approach would make version tracking any harder than natively installing the SDKs.

To be clear, the workaround suggested was to copy the source files from this repo (https://github.com/AppsFlyerSDK/segment-appsflyer-ios/tree/master/segment-appsflyer-ios/Classes) into your project. You'd still use cocoapods to integrate the AppsFlyer and Segment SDK's like this:

pod "Analytics"
pod "AppsFlyer"
...

This is a workaround because instead of a transitive dependency (segment-applslyfer-ios -> AppsFlyer), you depend on AppsFlyer directly, and copy the "mapping" (i.e. this integration) code into your app.

You'd be missing out on using the integration via Cocoapods (which is just this repo, not the core AppsFlyer SDK or Analytics SDK), and while it's not ideal, I think it's better than integrating the tools natively and having to write your mapping layers from scratch.