Skip to content
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

Issue with Statically Linked Binary DatadogCrashReporting in CocoaPods Integration #2118

Open
mohameditani opened this issue Nov 22, 2024 · 4 comments
Labels
awaiting response Waiting for response / confirmation from the reporter compilation issue SDK doesn't compile or gives warnings.

Comments

@mohameditani
Copy link

mohameditani commented Nov 22, 2024

Describe the issue

When integrating the DatadogCrashReporting pod into our project, we encountered an issue due to its inclusion of statically linked binaries. The error is as follows:

[!] The 'Pods-Cashier' target has transitive dependencies that include statically linked binaries: (DatadogCrashReporting)
This conflict arises because CocoaPods cannot integrate statically linked binaries into dynamic frameworks, which is the default configuration in many projects.

Podspec sample:

Pod::Spec.new do |s|

s.authors      = { '' => '' }
s.license      = { :type => '.' }
s.homepage     = '.'
s.source       = { :git => '', :tag => '4.1.0' }
s.summary      = '.'

s.name                  = "Logger"
s.platform              = :ios
s.ios.deployment_target = '15.0'
s.requires_arc          = true
s.source_files          = "Source/**/*.{swift}"
s.version               = "4.1.0"


s.dependency 'DatadogSDK'
s.dependency 'DatadogInternal'
s.dependency 'DatadogCrashReporting'
s.dependency 'XCGLogger'
s.dependency 'Constants'
s.dependency 'FirebaseCrashlytics'

end

Reproduction steps

Add the following to the podspec of a custom pod:
pod 'DatadogCrashReporting'
Run pod install.
Observe the error during the installation process.
Expected Behavior:
The DatadogCrashReporting pod should integrate successfully without causing conflicts with the target.

Actual Behavior:
The installation fails with an error about statically linked binaries.

Environment Details:

CocoaPods Version: [Specify your CocoaPods version]
Xcode Version: [Specify your Xcode version]
iOS Deployment Target: 15.0
Podfile Configuration:
use_frameworks!

Device Information

No response

SDK version

1.23.0

Integration Methods

Cocoapods

Xcode Version

16.1

Swift Version

6.0.2

MacOS Version

Sequoia 15.0.1

Deployment Target

15.0

Other relevant information

No response

@mohameditani mohameditani added the compilation issue SDK doesn't compile or gives warnings. label Nov 22, 2024
@maxep
Copy link
Member

maxep commented Nov 22, 2024

Hello @mohameditani,

Yes, our DatadogCrashReporting module is defined as static because its transitive dependency PLCrashReporter's podspec links to a static framework. For that reason, your podspec also requires to define s.static_framework = true.

I hope this helps.

@mohameditani
Copy link
Author

Hello @maxep ,

Thank you for your message. I tried that already and still similar error [!] The 'Pods-Cashier' target has transitive dependencies that include statically linked binaries: (Logger and DatadogCrashReporting)

Any other possible solutions?

@mariedm
Copy link
Member

mariedm commented Nov 25, 2024

Hello @mohameditani,

Here are a few suggestions to help troubleshoot the issue:

  • First, as @maxep suggested, make sure s.static_framework = true is present in your podspec file; this is required for your framework to work correctly
  • Additionally, verify that all dependencies are compatible with static linking to avoid conflicts
  • Check your Podfile.lock and check if dependencies are being linked statically or dynamically (and adjust if needed)
  • Specify explicit versions for your dependencies (e.g., s.dependency 'DatadogInternal', '~> 2.20.0') to avoid compatibility issues
  • Run pod spec lint to identify any warnings or errors that might indicate configuration issues

Hope that helps!

@mariedm mariedm added the awaiting response Waiting for response / confirmation from the reporter label Dec 2, 2024
@norhan-boghdadi
Copy link

Hello @mariedm,

Thank you for your response, I followed the above points but I still get the error: [!] The 'Pods-Cashier' target has transitive dependencies that include statically linked binaries: (Logger and DatadogCrashReporting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Waiting for response / confirmation from the reporter compilation issue SDK doesn't compile or gives warnings.
Projects
None yet
Development

No branches or pull requests

4 participants