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 Failed to handle method call #4

Closed
sheatming opened this issue Jun 12, 2019 · 4 comments
Closed

Android Failed to handle method call #4

sheatming opened this issue Jun 12, 2019 · 4 comments

Comments

@sheatming
Copy link

E/MethodChannel#majascan( 3947): Failed to handle method call
E/MethodChannel#majascan( 3947): android.content.ActivityNotFoundException: Unable to find explicit activity class {cc.x.mch/com.djgeo.majascan.g_scanner.QrCodeScannerActivity}; have you declared this activity in your AndroidManifest.xml?
E/MethodChannel#majascan( 3947): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2005)
E/MethodChannel#majascan( 3947): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1673)
E/MethodChannel#majascan( 3947): at android.app.Activity.startActivityForResult(Activity.java:4586)
E/MethodChannel#majascan( 3947): at android.app.Activity.startActivityForResult(Activity.java:4544)
E/MethodChannel#majascan( 3947): at com.djgeo.majascan.MajascanPlugin.onMethodCall(MajascanPlugin.kt:42)
E/MethodChannel#majascan( 3947): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201)
E/MethodChannel#majascan( 3947): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:88)
E/MethodChannel#majascan( 3947): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:219)
E/MethodChannel#majascan( 3947): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#majascan( 3947): at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#majascan( 3947): at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#majascan( 3947): at android.app.ActivityThread.main(ActivityThread.java:6669)
E/MethodChannel#majascan( 3947): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#majascan( 3947): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#majascan( 3947): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/flutter ( 3947): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, Unable to find explicit activity class {cc.x.mch/com.djgeo.majascan.g_scanner.QrCodeScannerActivity}; have you declared this activity in your AndroidManifest.xml?, null)
E/flutter ( 3947): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter ( 3947): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:302:33)
E/flutter ( 3947):
E/flutter ( 3947): #2 MajaScan.startScan (package:majascan/majascan.dart:31:42)
E/flutter ( 3947):
E/flutter ( 3947): #3 HoneState.build. (package:mch/app/pages/home/view.dart:275:118)
E/flutter ( 3947):
E/flutter ( 3947): #4 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:166:24)
E/flutter ( 3947): #5 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:240:9)
E/flutter ( 3947): #6 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:177:9)
E/flutter ( 3947): #7 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:436:9)
E/flutter ( 3947): #8 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12)
E/flutter ( 3947): #9 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11)
E/flutter ( 3947): #10 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:221:19)
E/flutter ( 3947): #11 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:199:22)
E/flutter ( 3947): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter ( 3947): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter ( 3947): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter ( 3947): #15 _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter ( 3947): #16 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter ( 3947): #17 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter ( 3947): #18 _invoke1 (dart:ui/hooks.dart:233:10)
E/flutter ( 3947): #19 _dispatchPointerDataPacket (dart:ui/hooks.dart:154:5)
E/flutter ( 3947):

`






    <activity android:name="com.djgeo.majascan.g_scanner.QrCodeScannerActivity"/>

`

@sheatming
Copy link
Author

<activity android:name=".MainActivity" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> <!-- This keeps the window background of the activity showing until Flutter renders its first frame. It can be removed if there is no splash screen (such as the default splash screen defined in @style/LaunchTheme). --> <meta-data android:name="io.flutter.app.android.SplashScreenUntilFirstFrame" android:value="true" /> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity>

<activity android:name="com.djgeo.majascan.g_scanner.QrCodeScannerActivity" android:configChanges="orientation" />

@XYZ217522
Copy link
Collaborator

Android
For Android, you must do the following before you can use the plugin:

  • Add the QrCodeScannerActivity to your AndroidManifest.xml

@legolas237
Copy link

I did it but it doesn't work

@saginbajracharya
Copy link

dosent work where to Add the QrCodeScannerActivity to your AndroidManifest.xml

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

4 participants