Skip to content

[Bug]: ios 16.2, share_plus:11.1.0, error:Use of undeclared identifier 'UIActivityTypeAddToHomeScreen' #3651

@huanguan1978

Description

@huanguan1978

Platform

Ios 16.2

Plugin

share_plus

Version

11.1.0

Flutter SDK

3.32.6

Steps to reproduce

I created a new project named hello using flutter create hello. Then, I added a new button with the following code:

                SharePlus.instance.share(
                  ShareParams(text: 'check out my website https://example.com'),
                );

When I try to run it on an iOS simulator, I get the following error.

Semantic Issue (Xcode): Use of undeclared identifier 'UIActivityTypeAddToHomeScreen'
/Users/kaguya/.pub-cache/hosted/pub.dev/share_plus-11.1.0/ios/share_plus/Sources/share_plus/FPPSharePlusPlugin.m:80:42

I'm sure that version 11.0.0 did not have this issue."

Code Sample

TextButton(
              onPressed: () {
                SharePlus.instance.share(
                  ShareParams(text: 'check out my website https://example.com'),
                );
              },
              child: const Text('share'),
            ),

Logs

Launching lib/main.dart on iPhone 14 Pro Max in debug mode...
Xcode build done.                                           10.6s
Failed to build iOS app
Semantic Issue (Xcode): Use of undeclared identifier 'UIActivityTypeAddToHomeScreen'
/Users/kaguya/.pub-cache/hosted/pub.dev/share_plus-11.1.0/ios/share_plus/Sources/share_plus/FPPSharePlusPlugin.m:80:42

Could not build the application for the simulator.
Error launching application on iPhone 14 Pro Max.

Exited (1).

Flutter Doctor

kaguya@kaguya-MacBookPro hello % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.6, on macOS 12.7.6 21H1320 darwin-x64, locale en-HK)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0-rc1)
[!] Xcode - develop for iOS and macOS (Xcode 14.2)
    ! Flutter recommends a minimum Xcode version of 15.
      Download the latest version or update via the Mac App Store.
[✓] Chrome - develop for the web
[✓] Android Studio (version 2025.1)
[✓] VS Code (version 1.103.1)
[✓] Proxy Configuration
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions