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

[Flutter Module][iOS] Multiple commands produce Datadog.framework #443

Closed
4rthurmonteiro opened this issue Jun 15, 2023 · 13 comments
Closed
Labels
bug Something isn't working

Comments

@4rthurmonteiro
Copy link
Contributor

4rthurmonteiro commented Jun 15, 2023

Describe what happened
Include any error message or stack trace if available.

We use a Flutter Module in our native ios app using the xcframeworks, running flutter build ios-framework .... When we implemented the datadog using the attachToExisting approach we had this error Multiple commands produce Datadog.framework because in the iOS project the datadog pods are included.

Steps to reproduce the issue:

Go to examples/native-hybrid-app and in the flutter module use the Option B ou C from https://docs.flutter.dev/add-to-app/ios/project-setup .

Describe what you expected:

The same result from the Option A from https://docs.flutter.dev/add-to-app/ios/project-setup .

Additional context

  • Dart/Flutter version: Flutter 3.10.3 and Dart 3.0.3
  • Android/iOS OS version: iOS 15
  • Device Model: Iphone 6S
  • Datadog SDK version: newest
  • Versions of any other relevant dependencies: Xcode 14.2
@4rthurmonteiro 4rthurmonteiro added the bug Something isn't working label Jun 15, 2023
@fuzzybinary
Copy link
Collaborator

fuzzybinary commented Jun 16, 2023

Hi @4rthurmonteiro ,

Thanks for reporting, I'll look into it. I'm not exactly sure how I can support Option B or C without supplying a completely separate package, since I don't think there's a way for me to exclude the pod dynamically, but maybe I'm just missing some option.

Would it be possible to remove the Datadog iOS SDK from the app side, and allow the datadog_flutter_plugin to supply
the framework instead?

@4rthurmonteiro
Copy link
Contributor Author

Hi @fuzzybinary

I will try remove the Datadog iOS SDK from the app side.

@4rthurmonteiro
Copy link
Contributor Author

4rthurmonteiro commented Jun 16, 2023

@fuzzybinary when i removed the Datadog iOS SDK from app side i received this error below:

image

@fuzzybinary
Copy link
Collaborator

Okay, I'll continue to investigate a fix.

@4rthurmonteiro
Copy link
Contributor Author

similar problem flutter/flutter#114692

@p-mazhnik
Copy link

@4rthurmonteiro
As a workaround, can you try deleting Datadog.framework produced by flutter build ios-framework command?
from flutter_module/build/ios/framework/**/Datadog.xcframework

@4rthurmonteiro
Copy link
Contributor Author

Hi @p-mazhnik

I tried deleting Datadog.framework but i received a lot of errors called Undefined symbols for architecture arm64 .

@p-mazhnik
Copy link

p-mazhnik commented Jun 20, 2023

@4rthurmonteiro
Ok. Then the best option will be to link only App.xcframework (& embed) and FlutterPluginRegistrant.xcframework (without embedding).
(So don't include Datadog-related frameworks: Datadog, datadog_flutter_plugin, DatadogCrashReporting and DictionaryCoder)

Main step will be to add datadog_flutter_plugin manually to Podfile:

pod 'datadog_flutter_plugin', :path => '../flutter_module/.ios/.symlinks/plugins/datadog_flutter_plugin/ios', :inhibit_warnings => true

UPD: Note that .ios/.symlinks/plugins/datadog_flutter_plugin path may not exists, but you can find actual path in .flutter-plugins-dependencies file

@4rthurmonteiro
Copy link
Contributor Author

@4rthurmonteiro Ok. Then the best option will be to link only App.xcframework (& embed) and FlutterPluginRegistrant.xcframework (without embedding). (So don't include Datadog-related frameworks: Datadog, datadog_flutter_plugin, DatadogCrashReporting and DictionaryCoder)

Main step will be to add datadog_flutter_plugin manually to Podfile:

pod 'datadog_flutter_plugin', :path => '../flutter_module/.ios/.symlinks/plugins/datadog_flutter_plugin/ios', :inhibit_warnings => true

Great! I will test this approach.

@4rthurmonteiro
Copy link
Contributor Author

@p-mazhnik i have some problems with this approach. So i followed like you did in flutter/flutter#114692 and worked!

How do you distribute your pods? Locally or remotely?

@fuzzybinary
Copy link
Collaborator

Hi folks -- is there something Datadog needs to change here or something we should add to our documentation to assist others with this scenario?

@4rthurmonteiro
Copy link
Contributor Author

@fuzzybinary i think Option B and C is not possible use the attached aproach. So just add this observation in the example.

fuzzybinary added a commit that referenced this issue Jun 28, 2023
Applications that add Flutter and the datadog_flutter_plugin with already existing instances of the Datadog SDK for iOS generate build time errors when using two of the options for embedding. This documents that those methods are not supported.

refs: #443
@fuzzybinary
Copy link
Collaborator

Closing with new documentation. If there ends up being a workaround we'll open another issue to track documenting the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants