Skip to content

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

Closed

Description

@4rthurmonteiro

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

Activity

  1. fuzzybinary commented on Jun 16, 2023

    @fuzzybinary
    Member

    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?

  2. 4rthurmonteiro commented on Jun 16, 2023

    @4rthurmonteiro
    ContributorAuthor

    Hi @fuzzybinary

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

  3. 4rthurmonteiro commented on Jun 16, 2023

    @4rthurmonteiro
    ContributorAuthor

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

    image
  4. fuzzybinary commented on Jun 16, 2023

    @fuzzybinary
    Member

    Okay, I'll continue to investigate a fix.

  5. 4rthurmonteiro commented on Jun 19, 2023

    @4rthurmonteiro
    ContributorAuthor

    similar problem flutter/flutter#114692

  6. p-mazhnik commented on Jun 20, 2023

    @p-mazhnik

    @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

  7. 4rthurmonteiro commented on Jun 20, 2023

    @4rthurmonteiro
    ContributorAuthor

    Hi @p-mazhnik

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

  8. p-mazhnik commented on Jun 20, 2023

    @p-mazhnik

    @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

  9. 4rthurmonteiro commented on Jun 20, 2023

    @4rthurmonteiro
    ContributorAuthor

    @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.

  10. 4rthurmonteiro commented on Jun 20, 2023

    @4rthurmonteiro
    ContributorAuthor

    @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?

  11. fuzzybinary commented on Jun 26, 2023

    @fuzzybinary
    Member

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

  12. 4rthurmonteiro commented on Jun 26, 2023

    @4rthurmonteiro
    ContributorAuthor

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

  13. fuzzybinary commented on Jul 5, 2023

    @fuzzybinary
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions