flutter / flutter/website

Flutter couldn't be found in share extension

Open
#12,834 1 comment 0 reactions 0 assignees View on GitHub
p2-medium target.iOS
Dominant language
Dart
Stars
3.1k
Forks
3.5k
Avg merge
2d 4h
Merged PRs (30d)
95

Description

### Steps to reproduce

I create share extension do what exactly this [link](https://docs.flutter.dev/platform-integration/ios/app-extensions) said and I get error

### Expected results

IOS app should be build without any errors and flutter embedded into share extension

### Actual results

Could not build the precompiled application for the device.
Swift Compiler Error (Xcode): Unable to find module dependency: 'Flutter'
import Flutter
^
/Users/mohammad/Projects/MyReels/mobile/ios/ShareExtension/ShareViewController.s
wift:1:7

### Code sample

Code sample

```swift
import UIKit
import Flutter

class ShareViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
showFlutter()
}

func showFlutter() {
let flutterEngine = FlutterEngine(name: "my flutter engine")
flutterEngine.run()
let flutterViewController = FlutterViewController(engine: flutterEngine, nibName: nil, bundle: nil)
addChild(flutterViewController)
view.addSubview(flutterViewController.view)
flutterViewController.view.frame = view.bounds
}

override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
self.extensionContext?.cancelRequest(
withError: NSError(domain: Bundle.main.bundleIdentifier!, code: 0))
}
}

```

### Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

### Logs

Logs

```console
[Paste your logs here]
```

### Flutter Doctor output

Doctor output

```console
[✓] Flutter (Channel stable, 3.35.7, on macOS 15.7.1 24G231 darwin-x64, locale
en-US) [745ms]
• Flutter version 3.35.7 on channel stable at /Users/mohammad/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision adc9010625 (8 weeks ago), 2025-10-21 14:16:03 -0400
• Engine revision 035316565a
• Dart version 3.9.2
• DevTools version 2.48.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop,
enable-windows-desktop, enable-android, enable-ios, cli-animations,
no-enable-lldb-debugging

[✗] Android toolchain - develop for Android devices [700ms]
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/to/macos-android-setup for detailed
instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.

[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1) [6.6s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17A400
• CocoaPods version 1.16.2

[✗] Chrome - develop for the web (Cannot find Chrome executable at
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome) [19ms]
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[!] Android Studio (not installed) [18ms]
• Android Studio not found; download from
https://developer.android.com/studio/index.html
(or visit https://flutter.dev/to/macos-android-setup for detailed
instructions).

[✓] VS Code (version 1.107.0) [18ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.124.0

[✓] Connected device (3 available) [9.9s]
• Mohammad (mobile) • 00008110-00180D993A06201E • ios •
iOS 26.1 23B85
• iPhone 16e (mobile) • A8F80FB5-BA94-4426-AED7-299D3EAB16CB • ios •
com.apple.CoreSimulator.SimRuntime.iOS-26-0 (simulator)
• macOS (desktop) • macos • darwin-x64 •
macOS 15.7.1 24G231 darwin-x64

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

! Doctor found issues in 3 categories.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.