Skip to content

[image_picker] Define clang modules plugin for iOS #41657

@jmagman

Description

@jmagman

Define clang modules in image_picker plugin to:

  1. Allow it to be imported into Swift apps as libraries without use_frameworks!.
  2. Allow it to be module imported @import into Objective-C apps.

See further details in #41007

Steps to Reproduce

Import into Swift app as a library

  1. flutter create test_create_app
  2. Add image_picker to the pubspec.
dependencies:
  flutter:
    sdk: flutter
  image_picker: any
  1. In generated ios/Podfile remove use_frameworks!
  2. flutter build ios
  3. In AppDelegate.swift add import image_picker at the top.
  4. Build.

Compilation error: no such module 'image_picker'

Module import (@import) into Objective-C app

  1. flutter create -i objc test_create_app
  2. Add image_picker.
dependencies:
  flutter:
    sdk: flutter
  image_picker: any
  1. flutter build ios
  2. In AppDelegate.m add @import image_picker; at the top.
  3. Build.

Compilation error: no such module 'image_picker'

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: existing-appsIntegration with existing apps via the add-to-app flowp: image_pickerThe Image Picker plugin.packageflutter/packages repository. See also p: labels.platform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions