plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Bug]: Whenever i try to share anything the app crashes.

Open Asim-9812 opened this issue 5 months ago • 3 comments

Platform

Android 16

Plugin

share_plus

Version

11.1.0

Flutter SDK

3.27.2

Steps to reproduce

Whenever i tried to share a text or url the whole application crashes. In beginning of the development there was no problem when i shared anything but it started occuring randomly recently and now everytime i try to share anything the app crashes

Code Sample

void sharePosts(String url) async{
  await SharePlus.instance.share(ShareParams(uri: Uri.parse(url), title: 'Test',subject: 'test'));
}

Logs

[ +459 ms] E/AndroidRuntime(17007): FATAL EXCEPTION: main
[   +1 ms] E/AndroidRuntime(17007): Process: android:ui, PID: 17007
[        ] E/AndroidRuntime(17007): java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object 
reference
[   +1 ms] E/AndroidRuntime(17007):     at android.text.SpannableStringBuilder.<init>(SpannableStringBuilder.java:52)
[        ] E/AndroidRuntime(17007):     at com.android.internal.app.chooser.SelectableTargetInfo.sanitizeDisplayLabel(SelectableTargetInfo.java:130)
[        ] E/AndroidRuntime(17007):     at com.android.internal.app.chooser.SelectableTargetInfo.<init>(SelectableTargetInfo.java:108)
[        ] E/AndroidRuntime(17007):     at
com.android.internal.app.ChooserListAdapter.lambda$parkTargetIntoMemory$3$ChooserListAdapter(ChooserListAdapter.java:759)
[        ] E/AndroidRuntime(17007):     at com.android.internal.app.-$$Lambda$ChooserListAdapter$8HtMdVlUWw1aFqhES60XWwoBEJA.apply(Unknown Source:13)
[        ] E/AndroidRuntime(17007):     at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:203)
[        ] E/AndroidRuntime(17007):     at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1390)
[        ] E/AndroidRuntime(17007):     at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
[        ] E/AndroidRuntime(17007):     at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:475)
[        ] E/AndroidRuntime(17007):     at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
[        ] E/AndroidRuntime(17007):     at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:236)
[        ] E/AndroidRuntime(17007):     at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:517)
[        ] E/AndroidRuntime(17007):     at com.android.internal.app.ChooserListAdapter.parkTargetIntoMemory(ChooserListAdapter.java:761)
[        ] E/AndroidRuntime(17007):     at com.android.internal.app.ChooserListAdapter.addServiceResults(ChooserListAdapter.java:558)
[        ] E/AndroidRuntime(17007):     at com.android.internal.app.ChooserActivity$ChooserHandler.handleMessage(ChooserActivity.java:554)
[        ] E/AndroidRuntime(17007):     at android.os.Handler.dispatchMessage(Handler.java:106)
[        ] E/AndroidRuntime(17007):     at android.os.Looper.loop(Looper.java:236)
[        ] E/AndroidRuntime(17007):     at android.app.ActivityThread.main(ActivityThread.java:8060)
[        ] E/AndroidRuntime(17007):     at java.lang.reflect.Method.invoke(Native Method)
[        ] E/AndroidRuntime(17007):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
[        ] E/AndroidRuntime(17007):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
[ +399 ms] W/om.karigar.mge(16544): Accessing hidden method

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.27.2, on Microsoft Windows [Version 10.0.19045.6216], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[√] Chrome - develop for the web
[!] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.46)
    X The current Visual Studio installation is incomplete.
      Please use Visual Studio Installer to complete the installation or reinstall Visual Studio.
[√] Android Studio (version 2025.1.2)
[√] VS Code (version 1.100.0)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 1 category.

Checklist before submitting a bug

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

Asim-9812 avatar Aug 19 '25 07:08 Asim-9812

I'm experiencing the same problem.

Aksoyhlc avatar Sep 07 '25 19:09 Aksoyhlc

I'm experiencing the same problem.

ashish10010 avatar Sep 16 '25 06:09 ashish10010

i am also facing the same issue

YashSah avatar Sep 22 '25 13:09 YashSah

Same here. Sometimes it works, sometimes it crashes.

flechajm avatar Dec 19 '25 20:12 flechajm