ShekarMudaliyar / social_share

Flutter package to share images/videos/text on social media
https://pub.dev/packages/social_share
MIT License
101 stars 166 forks source link

Crash on iOS when SocialShare.copyToClipboard called with null image #129

Open owen-ho opened 1 year ago

owen-ho commented 1 year ago

Steps to reproduce:

  1. Run app on physical iOS device
  2. Create button which calls SocialShare.copyToClipboard
  3. In parameters, enter a text but leave image null (i.e. SocialShare.copyToClipboard(text: 'Hello');)
  4. Click on button
  5. Crash occurs with this log:
    -[NSNull _fastCharacterContents]: unrecognized selector sent to instance 0x1f59f4558
    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull _fastCharacterContents]: unrecognized selector sent to instance 0x1f59f4558'
    *** First throw call stack:
    (0x19b1ddd78 0x1b3e42734 0x19b2bbb88 0x19b172988 0x19b171a60 0x19b157968 0x19b1913c8 0x19c95f8f8 0x19c9523e0 0x104b1188c 0x1079f6274 0x1074a558c 0x19ae42e68 0x19ae44a2c 0x19ae52f48 0x19ae52b98 0x19b1962f0 0x19b1501f4 0x19b1636b8 0x1b71fd374 0x19dac8e88 0x19d84a5ec 0x10295f88c 0x104059ce4)
    libc++abi: terminating with uncaught exception of type NSException
    * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001d2ca5b78 libsystem_kernel.dylib`__pthread_kill + 8
    libsystem_kernel.dylib`:
    ->  0x1d2ca5b78 <+8>:  b.lo   0x1d2ca5b98               ; <+40>
    0x1d2ca5b7c <+12>: pacibsp
    0x1d2ca5b80 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1d2ca5b84 <+20>: mov    x29, sp
    Target 0: (Runner) stopped.
    Lost connection to device.
    Exited

Flutter doctor:

[✓] Flutter (Channel stable, 3.7.7, on macOS 13.2.1 22D68 darwin-arm64, locale en-SG)
    • Flutter version 3.7.7 on channel stable at /Users/hosha/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2ad6cd72c0 (3 weeks ago), 2023-03-08 09:41:59 -0800
    • Engine revision 1837b5be5f
    • Dart version 2.19.4
    • DevTools version 2.20.1

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/hosha/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 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

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

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/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 11.0.13+0-b1751.21-8125866)

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

[✓] Connected device (2 available)
    • Owen’s iphone (mobile) • 00008101-001E7DDE3E39001E • ios          • iOS 15.4.1 19E258
    • macOS (desktop)        • macos                     • darwin-arm64 • macOS 13.2.1 22D68 darwin-arm64
    ! Error: Owen’s iphone is busy: Fetching debug symbols for Owen’s iphone. Xcode will continue when Owen’s iphone is finished. (code -10)

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.
haidang750 commented 1 year ago

Does the problem occur if we set image = ''?

owen-ho commented 1 year ago

nope, works fine if image is an empty string but on android the clipboard is replaced with the empty string instead of the text

GonzagaGIT commented 11 months ago

do we have any updates?

lucasvps commented 4 months ago

Any updates?

diegogava commented 3 weeks ago

Any updates? [2]