Skip to content

[Add2App] option B from iOS guide can't be used if app and module have a shared pod dependency #130220

Open

Description

@p-mazhnik

Option B from add to app iOS guide can't be used if app and module have a shared pod dependency.

I mentioned this issue in my feature request #114692 and it has a lot of details, but initially I didn't want to create a separate issue because I thought we had a simple workaround.

Steps to reproduce

  1. Integrate Flutter module into existing iOS app using Option B (or Option C) from the add2app iOS guide.
    (We can use prebuilt_module from the Flutter samples as an example)
  2. Make sure iOS app has a Cocoapods support.
    (prebuilt_module: run pod init from the ios_using_prebuilt_module directory)
  3. Add Cocoapods dependencies to the app.
    (to the ios_using_prebuilt_module).
  # Pods for IOSUsingPrebuiltModule
  pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '8.8.0'
  pod 'DatadogSDK' => '1.19.0'
  pod 'DatadogSDKCrashReporting' => '1.19.0'
  1. Add Flutter dependencies (plugins) to the module, these plugins should have dependencies we add in the step 2 as a direct/transitive dependencies.
    (add to the pubspec.yaml from the flutter_module directory)
datadog_flutter_plugin: 1.5.1
sentry_flutter: 7.8.0
  1. Build iOS frameworks from the Flutter module.
    (run flutter build ios-framework --output=../ios_using_prebuilt_module/Flutter from the flutter_module)
  2. Embed frameworks to the app following Option B from the 'add to an existing iOS app' guide.
  3. Open project in XCode and start app for the simulator
    (to open XCode from the flutter_module:
    open ../ios_using_prebuilt_module/IOSUsingPrebuiltModule.xcworkspace)

Expected results

iOS app is built and launched successfully.

Actual results

XCode build errors:

Multiple commands produce '/Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Products/Debug-iphonesimulator/IOSUsingPrebuiltModule.app/Frameworks/Datadog.framework'
Multiple commands produce '/Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Products/Debug-iphonesimulator/IOSUsingPrebuiltModule.app/Frameworks/Sentry.framework'

Warnings:

duplicate output file '/Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Products/Debug-iphonesimulator/IOSUsingPrebuiltModule.app/Frameworks/Datadog.framework' on task: PhaseScriptExecution [CP] Embed Pods Frameworks /Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Intermediates.noindex/IOSUsingPrebuiltModule.build/Debug-iphonesimulator/IOSUsingPrebuiltModule.build/Script-98112F522513510246BDAF44.sh
duplicate output file '/Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Products/Debug-iphonesimulator/IOSUsingPrebuiltModule.app/Frameworks/Sentry.framework' on task: PhaseScriptExecution [CP] Embed Pods Frameworks /Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Intermediates.noindex/IOSUsingPrebuiltModule.build/Debug-iphonesimulator/IOSUsingPrebuiltModule.build/Script-98112F522513510246BDAF44.sh

Code sample

Created a branch from the flutter/samples repository where I followed Steps to reproduce:
https://github.com/p-mazhnik/flutter-samples/tree/add2app-issue

Sample is add_to_app/prebuilt_module.

Logs

XCode Logs
Showing All Messages
Prepare packages
Prepare build
Multiple commands produce '/Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Products/Debug-iphonesimulator/IOSUsingPrebuiltModule.app/Frameworks/Datadog.framework'

Multiple commands produce '/Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Products/Debug-iphonesimulator/IOSUsingPrebuiltModule.app/Frameworks/Sentry.framework'

Multiple commands produce '/Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Products/Debug-iphonesimulator/IOSUsingPrebuiltModule.app/Frameworks/SentryPrivate.framework'

Building targets in dependency order

Computing target dependency graph and provisioning inputs

Build target IOSUsingPrebuiltModule
duplicate output file '/Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Products/Debug-iphonesimulator/IOSUsingPrebuiltModule.app/Frameworks/Datadog.framework' on task: PhaseScriptExecution [CP] Embed Pods Frameworks /Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Intermediates.noindex/IOSUsingPrebuiltModule.build/Debug-iphonesimulator/IOSUsingPrebuiltModule.build/Script-98112F522513510246BDAF44.sh

duplicate output file '/Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Products/Debug-iphonesimulator/IOSUsingPrebuiltModule.app/Frameworks/Sentry.framework' on task: PhaseScriptExecution [CP] Embed Pods Frameworks /Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Intermediates.noindex/IOSUsingPrebuiltModule.build/Debug-iphonesimulator/IOSUsingPrebuiltModule.build/Script-98112F522513510246BDAF44.sh

duplicate output file '/Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Products/Debug-iphonesimulator/IOSUsingPrebuiltModule.app/Frameworks/SentryPrivate.framework' on task: PhaseScriptExecution [CP] Embed Pods Frameworks /Users/mazhnik/Library/Developer/Xcode/DerivedData/IOSUsingPrebuiltModule-fslipirruxqfkpgbhswqnyfjfxeb/Build/Intermediates.noindex/IOSUsingPrebuiltModule.build/Debug-iphonesimulator/IOSUsingPrebuiltModule.build/Script-98112F522513510246BDAF44.sh



Activity Log Complete    09.07.2023, 10:05    0.2 seconds

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.5, on macOS 13.3.1 22E772610a darwin-arm64,
    locale ru-RU)
    • Flutter version 3.10.5 on channel stable at /Users/mazhnik/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (4 weeks ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/mazhnik/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • ANDROID_HOME = /Users/mazhnik/Library/Android/sdk
    • Java binary at: /Users/mazhnik/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.9971841
      /Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Users/mazhnik/Library/Application
      Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/222.4459.24.2221.9971841
      /Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.3)
    • IntelliJ at /Users/mazhnik/Applications/JetBrains Toolbox/IntelliJ IDEA
      Ultimate.app
    • Flutter plugin version 74.0.4
    • Dart plugin version 231.9161.14

[✓] IntelliJ IDEA Ultimate Edition (version 2023.1.3)
    • IntelliJ at /Users/mazhnik/Library/Application
      Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/231.9161.38/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.73.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.52.0

[✓] Connected device (3 available)
    • iPhone 14 Pro (mobile) • BB40A04B-5DC2-4B69-864F-8B42B652A2B5 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-16-4 (simulator)
    • macOS (desktop)        • macos                                •
      darwin-arm64   • macOS 13.3.1 22E772610a darwin-arm64
    • Chrome (web)           • chrome                               •
      web-javascript • Google Chrome 114.0.5735.198

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Proposal

  1. Update flutter add-to-app documentation to indicate that Options B & Option C have limitation in case flutter plugin and native iOS app have a shared dependency.
  2. Introduce new flag --[no-]-plugins for the build ios-framework command that excludes plugins from build (_producePlugins function is not called):
    [Add2App] provide flag for 'build ios-framework' command to build only App.xcframework #114692
  3. Introduce Option D that suggests developers to:
    • build frameworks using flutter build ios-framework --no-plugins
    • link & embed App.xcframework using option B
    • link & embed Flutter.xcframework using option B or C
    • link plugins to project by adding them to Podfile directly (e.g. by using install_flutter_plugin_pods, similar to Option A). Another advantage -- we don't need to determine whether plugin produce static or dynamic framework (like in option B when embed plugins frameworks manually), Cocoapods will do this for us.
      • If using install_flutter_plugin_pods we will run into a limitation:
        it requires Flutter and module dependencies to be installed locally. Workaround is to copy plugins somewhere and add them to project manually or using script similar to flutter_install_plugin_pods. I am not sure if we should provide such scripts to the developers.
      • we may also need a slightly different version of flutter_post_install script

Activity

  1. p-mazhnik commented on Jul 9, 2023

    @p-mazhnik
    ContributorAuthor

    Simple workaround that worked for me for some plugins:
    do not embed frameworks produced by Flutter for which we have the Multiple commands produce ... issue.

    For the sample code above, it means that we need to remove some frameworks from the Frameworks, Libraries, and Embedded Content section of the General target tab: Datadog.xcframework, Sentry.xcframework and SentryPrivate.xcframework. It worked for me previously for some plugins, for instance, if I have just sentry without datadog, it will work. Unfortunately, with the datadog and this workaround, we have multiple Undefined symbol issues:
    Build IOSUsingPrebuiltModule_2023-07-09T10-26-54.txt.
    This was also reported in the DataDog repo: DataDog/dd-sdk-flutter#443

    I believe this can't be a DataDogSdk issue, because all is working as expected using Option A. Probably it has smth to do with the fact that datadog_flutter_plugin.xcframework is static.

  2. p-mazhnik commented on Jul 9, 2023

    @p-mazhnik
    ContributorAuthor

    Complex workaround that involves combination of Options A and B and custom scripts, can be found here:
    #114692.

  3. darshankawar commented on Jul 10, 2023

    @darshankawar
    Member

    Thanks for the detailed report. I was able to replicate the reported behavior using the code sample and steps to replicate provided.

    stable, master flutter doctor -v
    [!] Flutter (Channel stable, 3.10.5, on macOS 12.2.1 21D62 darwin-x64, locale
        en-GB)
        • Flutter version 3.10.5 on channel stable at
          /Users/dhs/documents/fluttersdk/flutter
        ! Warning: `flutter` on your path resolves to
          /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
          your current Flutter SDK checkout at
          /Users/dhs/documents/fluttersdk/flutter. Consider adding
          /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
        ! Warning: `dart` on your path resolves to
          /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
          current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
          Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
          of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 796c8ef792 (2 days ago), 2023-06-13 15:51:02 -0700
        • Engine revision 45f6e00911
        • Dart version 3.0.5
        • DevTools version 2.23.1
        • If those were intentional, you can disregard the above warnings; however
          it is recommended to use "git" directly to perform update checks and
          upgrades.
    
    [!] Xcode - develop for iOS and macOS (Xcode 12.3)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        ! Flutter recommends a minimum Xcode version of 13.
          Download the latest version or update via the Mac App Store.
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] VS Code (version 1.62.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.21.0
    
    [✓] Connected device (5 available)
        • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
        • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
          ios            • iOS 14.4.1 18D61
        • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
          ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
        • macOS (desktop)            • macos                                    •
          darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
        • Chrome (web)               • chrome                                   •
          web-javascript • Google Chrome 98.0.4758.80
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
    [!] Flutter (Channel master, 3.12.0-15.0.pre.59, on macOS 12.2.1 21D62
        darwin-x64, locale en-GB)
        • Flutter version 3.12.0-15.0.pre.59 on channel master at
          /Users/dhs/documents/fluttersdk/flutter
        ! Warning: `flutter` on your path resolves to
          /Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
          your current Flutter SDK checkout at
          /Users/dhs/documents/fluttersdk/flutter. Consider adding
          /Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
        ! Warning: `dart` on your path resolves to
          /Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
          current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
          Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
          of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 5345221701 (4 hours ago), 2023-07-09 21:01:34 -0400
        • Engine revision 09c6ce4243
        • Dart version 3.1.0 (build 3.1.0-285.0.dev)
        • DevTools version 2.25.0
        • If those were intentional, you can disregard the above warnings; however
          it is recommended to use "git" directly to perform update checks and
          upgrades.
    
    
    [!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at /Users/dhs/Library/Android/sdk
        ✗ cmdline-tools component is missing
          Run `path/to/sdkmanager --install "cmdline-tools;latest"`
          See https://developer.android.com/studio/command-line for more details.
        ✗ Android license status unknown.
          Run `flutter doctor --android-licenses` to accept the SDK licenses.
          See https://flutter.dev/docs/get-started/install/macos#android-setup for
          more details.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 13C100
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2021.3.2)
        • IntelliJ at /Applications/IntelliJ IDEA.app
        • Flutter plugin version 65.1.4
        • Dart plugin version 213.7228
    
    [✓] VS Code (version 1.62.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.29.0
    
    [✓] Connected device (3 available)
        • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios
          • iOS 15.3.1 19D52
        • macOS (desktop)           • macos                                    •
          darwin-x64     • macOS 12.2.1 21D62 darwin-x64
        • Chrome (web)              • chrome                                   •
          web-javascript • Google Chrome 109.0.5414.119
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
          
    [!] Xcode - develop for iOS and macOS (Xcode 12.3)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        ! Flutter recommends a minimum Xcode version of 13.
          Download the latest version or update via the Mac App Store.
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] VS Code (version 1.62.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.21.0
    
    [✓] Connected device (5 available)
        • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
        • Darshan's iphone (mobile)  • 21150b119064aecc249dfcfe05e259197461ce23 •
          ios            • iOS 14.4.1 18D61
        • iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729     •
          ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
        • macOS (desktop)            • macos                                    •
          darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
        • Chrome (web)               • chrome                                   •
          web-javascript • Google Chrome 98.0.4758.80
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    
    
    
    
  4. added
    platform-iosiOS applications specifically
    a: existing-appsIntegration with existing apps via the add-to-app flow
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    d: api docsIssues with https://api.flutter.dev/
    team-iosOwned by iOS platform team
    and removed
    in triagePresently being triaged by the triage team
    on Jul 10, 2023
  5. added
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Jul 10, 2023
  6. 4rthurmonteiro commented on Sep 22, 2023

    @4rthurmonteiro
    Contributor

    Some update about this issue?

  7. nasko25 commented on Jan 15, 2024

    @nasko25

    I also encountered this issue.
    Is there an ETA on when it will be fixed?

    I see that --no-plugins has been mentioned as a potential fix. Does this include not building any custom flutter plugins used in the project as well? If so, how can we build a flutter plugin separately from the main flutter project, since any native Pod dependencies are defined in the main project's Podfile?

    Also, is there a way to define a custom Pod dependency only for a given flutter plugin?
    It can be defined for the main flutter project with something like this:

    target "Runner" do
      pod "CustomPod", git: "<url to git repo hosting the pod>"
    end
    

    But is there a way to define it only for a specific flutter plugin?

  8. 4rthurmonteiro commented on Jan 18, 2024

    @4rthurmonteiro
    Contributor

    Hello @nasko25,

    My solution was:

    App and Flutter

    1. generated te App.xcframework and Flutter.xcframework using o comand flutter build ios-framweork;
    2. and I created a pod for each;
    3. Finally, generate a tar.gz

    For example the app.podspec:

    Pod::Spec.new do |spec|
      spec.name         = "app_flutter"
      spec.version      = "0.0.1"
      spec.summary      = "Flutter module for My App"
      spec.description  = <<-DESC
        Flutter module for My App
                        DESC
      spec.homepage     = "your-urlr"
      spec.license      = { :type => "MIT", :text => "Free" }
      spec.author       = { "Arthur Monteiro" => "[email protected]" }
      spec.platform     = :ios, "12.0"
      spec.source       = { :http => "file://" + __dir__ + "/app.tar.gz" }
      spec.vendored_frameworks = 'App.xcframework'
      spec.requires_arc = true
      spec.static_framework = true
    

    So in the podfile you can just add this podspec.

    pod "app_flutter", ...
    
    

    Plugins

    Whene you do the flutter pub get, a flutter-plugins-dependencies is generated with all the plugins necessary to run your flutter module. Also, in .ios/Flutter has a folder called FlutterPluginRegistrant with all dependencies.

    Basically you can add the FlutterPluginRegistrant pod in your podfile and use a private cocoapods repo (Ex. Jfrog Artifactory) with the pods. Maybe you can use git too.

    For example, my app has geolocator and maps. So the ios plugins in the FlutterPluginRegistrant I uploaded all to Jfrog.

    In my case I use the Jfrog and works fine.

    Example: Podfile

    plugin 'cocoapods-art', :sources => [
    'artifactory-ios'
    ]
    
      pod 'app_flutter', '2.2.0' # my module pod in Jfrog
      pod 'Flutter', '3.16.2' # the flutter version used to generated de app framework (needs to be the same)
      pod 'FlutterPluginRegistrant', '2.2.0' # my version of FlutterPluginRegistrant in Jfrog. 
    
  9. nasko25 commented on Jan 25, 2024

    @nasko25

    Hey @4rthurmonteiro

    Thank you for sharing your solution.

  10. added
    P3Issues that are less important to the Flutter project
    and removed
    P2Important issues not at the top of the work list
    on Feb 12, 2024
  11. prasadsunny1 commented on Jul 25, 2024

    @prasadsunny1
    Contributor

    @4rthurmonteiro have you written about how you did it?
    I am trying what you have suggested here, but I am stuck at the point where you are asking to create a pod lib for each dependency under /ios/.symlinks/plugin_name/ios

    Basically you can add the FlutterPluginRegistrant pod in your podfile and use a private cocoapods repo (Ex. Jfrog
    Artifactory) with the pods. Maybe you can use git too.

  12. 4rthurmonteiro commented on Sep 18, 2024

    @4rthurmonteiro
    Contributor

    @4rthurmonteiro have you written about how you did it? I am trying what you have suggested here, but I am stuck at the point where you are asking to create a pod lib for each dependency under /ios/.symlinks/plugin_name/ios

    Basically you can add the FlutterPluginRegistrant pod in your podfile and use a private cocoapods repo (Ex. Jfrog
    Artifactory) with the pods. Maybe you can use git too.

    hey @prasadsunny1 ! Did you get it?

  13. EvanMasterson commented on Mar 5, 2025

    @EvanMasterson

    We have run into the exact same issue with the Add to App approach via Option B, we chose option B as our project is solely SPM, we do not want to integrate Cocoapods, it is at end of life.
    Our native app has Datadog SDK in it, and we would also like to integrate Datadog SDK on the flutter side, all workarounds described above are not an option for a project that solely uses SPM. This would happen also with other SDK's such as Firebase.
    Are there any known solutions for SPM? If not, is there work being done around this, if so is there an ETA?

    I've found these #146957 and DataDog/dd-sdk-flutter#443 which outlines exactly the same issue.
    It is not really acceptable that even defined in the limitations is to link via podspec, which brings Cocoapods back into the picture, https://docs.flutter.dev/add-to-app/ios/project-setup#method-b-limits

  14. iamnabink commented on Sep 14, 2025

    @iamnabink

    Any solution on this?

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

    P3Issues that are less important to the Flutter projecta: existing-appsIntegration with existing apps via the add-to-app flowd: api docsIssues with https://api.flutter.dev/found in release: 3.10Found to occur in 3.10found in release: 3.12Found to occur in 3.12has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions