razorpay / razorpay-flutter

Razorpay Flutter Plugin
MIT License
106 stars 150 forks source link

Unable to find explicit activity class com.razorpay.CheckoutActivity}; have you declared this activity in your AndroidManifest.xml? #10

Closed vivekkujur closed 5 years ago

vivekkujur commented 5 years ago

hi , iam using flutter getting error when _razorpay.open(options);

void openCheckout() async {

var options = {
  'key': 'rzp_test_1DP5mmOlF5G5ag',
  'amount': 2000,
  'name': 'Acme Corp.',
  'description': 'Fine T-Shirt',
  'prefill': {
    'contact': '8888888888',
    'email': 'test@razorpay.com'
  },
  'external': {
    'wallets': ['paytm']
  }
};

try {
  _razorpay.open(options);
} catch (e) {
  debugPrint(e);
}

}

error stack: - E/MethodChannel#razorpay_flutter( 1109): Failed to handle method call E/MethodChannel#razorpay_flutter( 1109): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.foodmonk.androidapp/com.razorpay.CheckoutActivity}; have you declared this activity in your AndroidManifest.xml? E/MethodChannel#razorpay_flutter( 1109): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2012) E/MethodChannel#razorpay_flutter( 1109): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1675) E/MethodChannel#razorpay_flutter( 1109): at android.app.Activity.startActivityForResult(Activity.java:4586) E/MethodChannel#razorpay_flutter( 1109): at android.app.Activity.startActivityForResult(Activity.java:4544) E/MethodChannel#razorpay_flutter( 1109): at com.razorpay.razorpay_flutter.RazorpayDelegate.openCheckout(RazorpayDelegate.java:55) E/MethodChannel#razorpay_flutter( 1109): at com.razorpay.razorpay_flutter.RazorpayFlutterPlugin.onMethodCall(RazorpayFlutterPlugin.java:43) E/MethodChannel#razorpay_flutter( 1109): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:201) E/MethodChannel#razorpay_flutter( 1109): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:88) E/MethodChannel#razorpay_flutter( 1109): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:219) E/MethodChannel#razorpay_flutter( 1109): at android.os.MessageQueue.nativePollOnce(Native Method) E/MethodChannel#razorpay_flutter( 1109): at android.os.MessageQueue.next(MessageQueue.java:326) E/MethodChannel#razorpay_flutter( 1109): at android.os.Looper.loop(Looper.java:160) E/MethodChannel#razorpay_flutter( 1109): at android.app.ActivityThread.main(ActivityThread.java:6762) E/MethodChannel#razorpay_flutter( 1109): at java.lang.reflect.Method.invoke(Native Method) E/MethodChannel#razorpay_flutter( 1109): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) E/MethodChannel#razorpay_flutter( 1109): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

ChintanAcharya commented 5 years ago

@vivekkujur Can you help us with the following details:

While we try to reproduce the issue, can you check if the add-manifest branch of the plugin fixes it? ( Change ref: "v1.0.0-alpha" to ref: "add-manifest" in pubspec.yml, and run flutter packages get )

ShubhraRao commented 4 years ago

Did you find a solution this? I have been facing the same problem and cannot seem to find any solution for it. This is the error I get. Pleas help me.

E/flutter (29223): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Unable to find explicit activity class {com.example.packagename/com.razorpay.CheckoutActivity}; have you declared this activity in your AndroidManifest.xml?, null) E/flutter (29223): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7) E/flutter (29223): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18) E/flutter (29223): E/flutter (29223): #2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12) E/flutter (29223): #3 Razorpay.open (package:razorpay_flutter/razorpay_flutter.dart:48:35) E/flutter (29223): #4 _HomeState.openCheckout E/flutter (29223): #5 _HomeState.build. E/flutter (29223): #6 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779:19) E/flutter (29223): #7 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:862:36) E/flutter (29223): #8 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24) E/flutter (29223): #9 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504:11) E/flutter (29223): #10 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5) E/flutter (29223): #11 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:217:7) E/flutter (29223): #12 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:475:9) E/flutter (29223): #13 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12) E/flutter (29223): #14 PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:122:9) E/flutter (29223): #15 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8) E/flutter (29223): #16 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18) E/flutter (29223): #17 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7) E/flutter (29223): #18 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19) E/flutter (29223): #19 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22) E/flutter (29223): #20 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7) E/flutter (29223): #21 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7) E/flutter (29223): #22 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7) E/flutter (29223): #23 _rootRunUnary (dart:async/zone.dart:1196:13) E/flutter (29223): #24 _CustomZone.runUnary (dart:async/zone.dart:1085:19) E/flutter (29223): #25 _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7) E/flutter (29223): #26 _invoke1 (dart:ui/hooks.dart:275:10) E/flutter (29223): #27 _dispatchPointerDataPacket (dart:ui/hooks.dart:184:5) E/flutter (29223): D/InputTransport(29223): Input channel constructed: fd=92 D/ViewRootImpl@d0f7427Toast: setView = android.widget.LinearLayout{22286d4 V.E...... ......I. 0,0-0,0} TM=true MM=false V/Toast (29223): Text: Zour in android.widget.Toast$TN@9c0307d D/ViewRootImpl@d0f7427Toast: dispatchAttachedToWindow V/Surface (29223): sf_framedrop debug : 0x4f4c, game : false, logging : 0 D/ViewRootImpl@d0f7427Toast: Relayout returned: old=[0,0][0,0] new=[86,1507][993,1728] result=0x7 surface={valid=true 3338055680} changed=true D/ViewRootImpl@d0f7427Toast: MSG_RESIZED_REPORT: frame=Rect(86, 1507 - 993, 1728) ci=Rect(0, 0 - 0, 0) vi=Rect(0, 0 - 0, 0) or=1 D/ViewRootImpl@d0f7427Toast: dispatchDetachedFromWindow D/InputEventReceiver(29223): channel '901247d Toast (client)' ~ Disposing input event receiver. D/InputEventReceiver(29223): channel '901247d Toast (client)' ~NativeInputEventReceiver. D/InputTransport(29223): Input channel destroyed: fd=92

R-rama commented 2 years ago

i am getting this error pls help me? Unhandled Exception: PlatformException(error, Unable to find explicit activity class {com.example.custom_razorpay/com.razorpay.flutter_customui.RazorpayPaymentActivity}; have you declared this activity in your AndroidManifest.xml?, null, android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.custom_razorpay/com.razorpay.flutter_customui.RazorpayPaymentActivity}; have you declared this activity in your AndroidManifest.xml?