plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

Share Plus cannot share static resource images

Open luokunman opened this issue 3 years ago • 3 comments

E/flutter (11662): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(Share failed, assets/avatar-default.png: The source file doesn't exist., null, null)
E/flutter (11662): #0      StandardMethodCodec.decodeEnvelope
package:flutter/…/services/message_codecs.dart:607
E/flutter (11662): #1      MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:167
E/flutter (11662): <asynchronous suspension>

flutter doctor

[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.19043.1526], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] Connected device (3 available)

code


    Share.shareFiles(
      ["assets/avatar-default.png"],
      subject: 'test-subject',
      text: 'test-text',
    );

Thank you for your attention to this issue.

luokunman avatar Apr 12 '22 02:04 luokunman

You can not simply access your static assets like that in Flutter. Please read the documentation "Adding assets and images" before reporting a bug.

Coronon avatar Apr 14 '22 09:04 Coronon

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Jun 14 '22 00:06 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Sep 19 '22 00:09 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Dec 29 '22 00:12 github-actions[bot]