Skip to content

integration_test embedded in shipping iOS apps when added to pubspec #74274

Open

Description

@jmagman

@matanlurey update as of 2024-11-20:

As of HEAD today, with the following feature flag opt-in:

flutter config explicit-package-dependencies

The generated .flutter-plugins-dependencies file now includes dev_dependency: true|false per plugin. See #158009 for implementation details. We should be able to use the explicit appearance of dev_dependency: true in order to strip out plugins (such as integration_test) that are dev dependencies in production builds.


Original post:

integration_test was added to the pubspec template in #70240. This caused all newly flutter created iOS apps to ship with an embedded integration_test framework, and it requires all developers to install CocoaPods, even if they had not previously used any plugins. It also embedded the app in add-to-app host apps.

#70240 was reverted in #74068 due to NNBD issues. Before it is relanded, there should be a plan for how to prevent the above.

See also #68818

Activity

  1. jmagman commented on Jan 20, 2021

    @jmagman
    MemberAuthor

    For the iOS side at least:

    Avoid embedding in app

    1. dev_dependencies could be parsable from .flutter-plugins-dependencies (Strip plugins created from dev_dependencies from release-mode apps #56591)
      The injectPlugins/GeneratedPluginRegistrant code would also need to ignore dev_dependencies.
      List<Map<String, dynamic>> _extractPlatformMaps(List<Plugin> plugins, String type) {
      final List<Map<String, dynamic>> pluginConfigs = <Map<String, dynamic>>[];
      for (final Plugin p in plugins) {
      final PluginPlatform platformPlugin = p.platforms[type];
      if (platformPlugin != null) {
      pluginConfigs.add(platformPlugin.toMap());
      }
      }
      return pluginConfigs;
      }

    Then the podhelper can exclude those plugins:

    return [] unless dependencies_hash.has_key?('plugins')
    return [] unless dependencies_hash['plugins'].has_key?('ios')

    Something like

    return [] if dependencies_hash['plugins'].has_key?('dev_dependency')
    1. integration_test can be hard-coded to be ignored in these places.

    Embed in test

    To add integration_test to the test target, it can be added via CocoaPods:

      target 'RunnerTests' do
        pod 'integration_test'
      end

    Or we can figure out how to do this as a Swift Package #72482.

    If there's plans to add the test target to the Xcode project template, this embedding can be done automatically.

  2. added
    a: tests"flutter test", flutter_test, or one of our tests
    on Jan 20, 2021
  3. jmagman commented on Jan 20, 2021

    @jmagman
    MemberAuthor
  4. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Jan 20, 2021
  5. bartekpacia commented on Dec 16, 2022

    @bartekpacia
    Member

    I'd really like to see it fixed. It makes it harder than necessary to develop a Flutter plugin that is intended to use only in integration tests.

  6. added
    P2Important issues not at the top of the work list
    on Jul 23, 2023
  7. self-assigned this
    on Oct 22, 2024
  8. matanlurey commented on Feb 12, 2025

    @matanlurey
    Contributor

    @cbracken Just checking in - this functionality is currently working e2e in Android, but not iOS. I'd love to get this into the next (not this) stable release so we can announce at the same time that both Android and iOS support it, but it's not critical.

  9. matanlurey commented on Feb 22, 2025

    @matanlurey
    Contributor

    This is ready to get worked on whenever prioritized; see #163874 (can dedupe)

  10. flutter-triage-bot commented on Jul 3, 2025

    @flutter-triage-bot

    This issue is assigned to @vashworth but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!

  11. added
    ⏳Bot is counting down the days until it unassigns the issue
    on Jul 3, 2025
  12. flutter-triage-bot commented on Sep 18, 2025

    @flutter-triage-bot

    This issue was assigned to @vashworth but has had no status updates in a long time. To remove any ambiguity about whether the issue is being worked on, the assignee was removed.

  13. removed
    ⏳Bot is counting down the days until it unassigns the issue
    on Sep 18, 2025
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

    P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our testsf: integration_testThe flutter/packages/integration_test pluginplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-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