d-silveira / flutter-share

complete flutter share plugin
BSD 3-Clause "New" or "Revised" License
98 stars 56 forks source link

Share.file only seding the text #32

Open aryan29 opened 4 years ago

aryan29 commented 4 years ago
                        await Share.file(
                        path: "file://" +app.apkFilePath,
                         mimeType: ShareType.TYPE_FILE,
                         title: "Something",
                          text:"Ok lets try")

I am using this firstI was using only app.apkFilePath but after reading 1 issue I tried adding file:// before that but when I share , it shares only text can anybody help me out And yes one more thaing that if I am trying wihtout text I am getting error saying non empty text

E/MethodChannel#plugins.flutter.io/share(30208): Failed to handle method call
E/MethodChannel#plugins.flutter.io/share(30208): java.lang.IllegalArgumentException: Non-empty text expected
E/MethodChannel#plugins.flutter.io/share(30208):        at io.flutter.plugins.share.Share.share(Share.java:34)
E/MethodChannel#plugins.flutter.io/share(30208):        at io.flutter.plugins.share.MethodCallHandler.onMethodCall(MethodCallHandler.java:27)
E/MethodChannel#plugins.flutter.io/share(30208):        at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:226)
E/MethodChannel#plugins.flutter.io/share(30208):        at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#plugins.flutter.io/share(30208):        at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
E/MethodChannel#plugins.flutter.io/share(30208):        at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.flutter.io/share(30208):        at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#plugins.flutter.io/share(30208):        at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#plugins.flutter.io/share(30208):        at android.app.ActivityThread.main(ActivityThread.java:6692)
E/MethodChannel#plugins.flutter.io/share(30208):        at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/share(30208):        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#plugins.flutter.io/share(30208):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/flutter (30208): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Non-empty text expected, null)
E/flutter (30208): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (30208): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)
E/flutter (30208): <asynchronous suspension>
E/flutter (30208): #2      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
E/flutter (30208): #3      Share.share (package:share/share.dart:218:20)
E/flutter (30208): #4      _ApkExtractorState.getList.<anonymous closure>.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:apkextractor/main.dart:151:48)
E/flutter (30208): #5      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779:19)
E/flutter (30208): #6      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:862:36)
E/flutter (30208): #7      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (30208): #8      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504:11)
E/flutter (30208): #9      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5)
E/flutter (30208): #10     BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:217:7)
E/flutter (30208): #11     PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:475:9)
E/flutter (30208): #12     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12)
E/flutter (30208): #13     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:122:9)
E/flutter (30208): #14     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8)
E/flutter (30208): #15     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18)
E/flutter (30208): #16     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7)
E/flutter (30208): #17     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
E/flutter (30208): #18     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (30208): #19     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (30208): #20     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (30208): #21     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (30208): #22     _rootRunUnary (dart:async/zone.dart:1196:13)
E/flutter (30208): #23     _CustomZone.runUnary (dart:async/zone.dart:1085:19)
E/flutter (30208): #24     _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7)
E/flutter (30208): #25     _invoke1 (dart:ui/hooks.dart:275:10)
E/flutter (30208): #26     _dispatchPointerDataPacket (dart:ui/hooks.dart:184:5)
E/flutter (30208): 
enriquerod commented 4 years ago

same issue