Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android.content.ActivityNotFoundException: No Activity found to handle Intent #41

Closed
itlws opened this issue May 7, 2019 · 1 comment

Comments

@itlws
Copy link

itlws commented May 7, 2019

遇到一个问题,Android上出现的,如果手机上没有安装可以打开word文档的app时,打开word文档报错:android.content.ActivityNotFoundException: No Activity found to handle Intent{ act=android.intent.action.VIEW cat=[andr oid.intent.category.DEFAULT] dat=content://com.crazecoder.openfileexample.fileProvider/external-path/test.docx typ=application/vnd.openxmlformats-officedo cument.wordprocessingml.document flg=0x20000001 }

E/MethodChannel#open_file( 7299): Failed to handle method call E/MethodChannel#open_file( 7299): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[andr oid.intent.category.DEFAULT] dat=content://com.crazecoder.openfileexample.fileProvider/external-path/test.docx typ=application/vnd.openxmlformats-officedo cument.wordprocessingml.document flg=0x20000001 } E/MethodChannel#open_file( 7299): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1805) E/MethodChannel#open_file( 7299): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1514) E/MethodChannel#open_file( 7299): at android.app.Activity.startActivityForResult(Activity.java:4028) E/MethodChannel#open_file( 7299): at android.app.Activity.startActivityForResult(Activity.java:3989) E/MethodChannel#open_file( 7299): at android.app.Activity.startActivity(Activity.java:4312) E/MethodChannel#open_file( 7299): at android.app.Activity.startActivity(Activity.java:4280) E/MethodChannel#open_file( 7299): at com.crazecoder.openfile.OpenFilePlugin.startActivity(OpenFilePlugin.java:135) E/MethodChannel#open_file( 7299): at com.crazecoder.openfile.OpenFilePlugin.onMethodCall(OpenFilePlugin.java:87) E/MethodChannel#open_file( 7299): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201) E/MethodChannel#open_file( 7299): at io.flutter.view.FlutterNativeView$PlatformMessageHandlerImpl.handleMessageFromDart(FlutterNativeView.java:188) E/MethodChannel#open_file( 7299): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:202) E/MethodChannel#open_file( 7299): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#open_file( 7299): at android.os.MessageQueue.next(MessageQueue.java:323) E/MethodChannel#open_file( 7299): at android.os.Looper.loop(Looper.java:141) E/MethodChannel#open_file( 7299): at android.app.ActivityThread.main(ActivityThread.java:5684) E/MethodChannel#open_file( 7299): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#open_file( 7299): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:746) E/MethodChannel#open_file( 7299): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636) E/flutter ( 7299): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, No Activity found to handle Intent { act=and roid.intent.action.VIEW cat=[android.intent.category.DEFAULT] dat=content://com.crazecoder.openfileexample.fileProvider/external-path/test.docx typ=applic ation/vnd.openxmlformats-officedocument.wordprocessingml.document flg=0x20000001 }, null) E/flutter ( 7299): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7) E/flutter ( 7299): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33) E/flutter ( 7299): <asynchronous suspension> E/flutter ( 7299): #2 OpenFile.open (package:open_file/open_file.dart:10:27) E/flutter ( 7299): <asynchronous suspension> E/flutter ( 7299): #3 _MyAppState.openFile (package:open_file_example/main.dart:18:36) E/flutter ( 7299): <asynchronous suspension> E/flutter ( 7299): #4 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:513:14) E/flutter ( 7299): #5 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:568:30) E/flutter ( 7299): #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:120:24) E/flutter ( 7299): #7 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:242:9) E/flutter ( 7299): #8 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:175:7) E/flutter ( 7299): #9 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:369:9) E/flutter ( 7299): #10 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12) E/flutter ( 7299): #11 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11) E/flutter ( 7299): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:214:19) E/flutter ( 7299): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:192:22) E/flutter ( 7299): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:149:7) E/flutter ( 7299): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:101:7) E/flutter ( 7299): #16 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:85:7) E/flutter ( 7299): #17 _rootRunUnary (dart:async/zone.dart:1136:13) E/flutter ( 7299): #18 _CustomZone.runUnary (dart:async/zone.dart:1029:19) E/flutter ( 7299): #19 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7) E/flutter ( 7299): #20 _invoke1 (dart:ui/hooks.dart:223:10) E/flutter ( 7299): #21 _dispatchPointerDataPacket (dart:ui/hooks.dart:144:5) E/flutter ( 7299):

@fkranenburg
Copy link

Any progress on this? I'm having this issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants