razorpay / razorpay-flutter

Razorpay Flutter Plugin
MIT License
106 stars 144 forks source link

Smart_Auth package using in flutter this code call void requestHint() async { final res = await smartAuth.requestHint( isPhoneNumberIdentifierSupported: true, isEmailAddressIdentifierSupported: true, showCancelButton: true, ); debugPrint('requestHint: $res'); } add razorpay_flutter dependencies app crash #382

Closed NileshBusysoft closed 1 month ago

NileshBusysoft commented 2 months ago

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest Razorpay Flutter plugin release to make sure your issue has not already been fixed:

Flutter Version :

Run flutter version in your terminal and copy the results here.

Xcode Version :

Open Xcode > Go to About Xcode > copy the Xcode version here.

Cocoapod Version :

Go to iOS folder > open podfile.lock > copy the razorpay-pod version and razorpay_fluttera version.

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

1. 2.

Expected Results

Describe what you expected to happen.

Snack, code example, screenshot, or link to a repository:

Please provide a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve

vivekshindhe commented 2 months ago

@NileshBusysoft can you add crash logs and reproducible steps? Also, please add the code snippet you are referring to inside the ticket instead of the title for easy reading. Thanks.

traditionalwears commented 1 month ago

@vivekshindhe Please update the package to support latest flutter, looks like you abandoned the package.

I can't integrate razorpay to my flutter app. It's urgent

traditionalwears commented 1 month ago

@vivekshindhe any progess on new release ?. Getting lot of issues and can't able to build the apk file, if I add the razorpay plugin.

traditionalwears commented 1 month ago

I thinks its waste of time to depend on razorpay, such a horrible experience. There is no way to connect anyone for the support. I've been trying integrate the razorpay on flutter app, my app is in production still because of these issues with flutter plugin couldn't able to add to my app, and no one is responding.

vivekshindhe commented 1 month ago

@traditionalwears @NileshBusysoft Hey folks, apologies for the delay in getting to this. We always strive to give the best experience when using the Razorpay's SDKs. But for future reference, if things get slipped through our fingers on Github tickets, please raise a ticket through the razorpay dashboard. We'll be able to get back to you with a much sooner TAT.

Coming to the issue, I believe the issue you folks were facing was this, java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/auth/api/credentials/HintRequest$Builder; E/AndroidRuntime(27252): at fman.ge.smart_auth.SmartAuthPlugin.requestHint(SmartAuthPlugin.kt:117) E/AndroidRuntime(27252): at fman.ge.smart_auth.SmartAuthPlugin.onMethodCall(SmartAuthPlugin.kt:77) E/AndroidRuntime(27252): at Reasoning: Razorpay-flutter package also tries to add the com.google.android.gms:play-services-auth library for Auto-Read and Submit of the OTP for Saved Cards and Native OTP feature. The error happens because the smart_auth package is using a deprecated feature **HintRequest** as seen in the logs. This is the reason of the crash.

The smart_auth package needs to update their SDK to remove the deprecated feature. But to unblock you folks for this moment, you can use this workaround,

Steps:

  1. Open the android project of your flutter application.
  2. Once the gradle is built, open the build.gradle file for the razorpay-flutter module.
  3. Replace line no 36 with the following code snippet api ('com.razorpay:checkout:1.6.+'){ exclude group:'com.google.android.gms', module:'play-services-auth' exclude group:'com.google.android.gms', module:'play-services-auth-api-phone' }

This is effectively telling the Razorpay SDK to not include those transitive dependencies.

  1. Once replaced, sync the project with gradle files and restart the application. This issue should be resolved.

We won't be able to reduce the version of play-services-auth used for separate reasons but the smart_auth package should be able to use the updated feature PhoneNumberHintApi.

traditionalwears commented 1 month ago

@vivekshindhe And there is an another issue with namespace and package_info_plus should be upgrade to the latest version. I forked the repo and made the changes, but I'm getting an issue with UpiTurbo.

vivekshindhe commented 1 month ago

Regarding the namespace and the package_info_plus upgrade, a release will be made tomorrow by 12. You should be able to use that version. @traditionalwears

traditionalwears commented 1 month ago

@vivekshindhe okay, hope it works. Thank You. And also solve the issue with smart_auth.

vivekshindhe commented 1 month ago

And also solve the issue with smart_auth.

@traditionalwears There is nothing we can do for the smart_auth package issue since we cannot downgrade versions of dependencies to let another package use a deprecated functionality. The workaround I provided above can only be added from your end.

Adding to this, I've fixed the namespace issue, but regarding package_info_plus, I am not seeing any errors even for the latest flutter( 3.22.0 ) and dart ( 3.4.0 ) versions. Is it possible for you to send the error you are seeing and the result of flutter --version?

traditionalwears commented 1 month ago

@vivekshindhe I'm using another package appwrite that depends on the latest package_info_plus and I cannot downgrade the appwrite package. When I tried to install the razorpay_flutter package, it showed conflict error. If you upgrade the package_info_plus to the latest version ^8.0.0, this issue will be solved.

traditionalwears commented 1 month ago

@vivekshindhe you said you will release a new version today, any update on that ..?

vivekshindhe commented 1 month ago

@traditionalwears updating the package_plus_info to 8.0.0 was breaking it for older flutter and dart versions. We are currently looking into removing this dependency completely. Will update once done. You can expect a release by EOD today.

traditionalwears commented 1 month ago

Okay Thank you.

vivekshindhe commented 1 month ago

@traditionalwears Hi, the release is stuck due to an issue on our CI. This will be resolved by tomorrow. Before that, can you try installing the razorpay-flutter package from a particular branch? This way, we can verify that the issues you've been facing will be fixed. Please add the following to your pubspec.yaml.

  razorpay_flutter:
    git:
      url: "https://github.com/razorpay/razorpay-flutter.git"
      ref: "b/namespace-fix-flutter"
vivekshindhe commented 1 month ago

Hey folks, version 1.3.7 was released in razorpay-flutter. This will fix the namespace and package_info_plus issues.

Please try with this version. I'll be keeping this ticket open for a while. Please let me know if you are facing any issues in the upgrade.

ain-py commented 1 month ago

Hey @vivekshindhe , I believe this issue has still not been fixed.

razorpay_flutter: ^1.3.7 package does not work with smart_auth: ^2.0.0

Steps to reproduce this error:

Debug Console: E/AndroidRuntime(31289): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(31289): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:603) E/AndroidRuntime(31289): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) E/AndroidRuntime(31289): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.auth.api.credentials.HintRequest$Builder" on path: DexPathList[[zip file "/data/app/~~owVLGPQgutGoiEDD6WPxfA==/com.nikahforever-C9FTciA8_hEg9meOO5s8CA==/base.apk"],nativeLibraryDirectories=[/data/app/~~owVLGPQgutGoiEDD6WPxfA==/com.nikahforever-C9FTciA8_hEg9meOO5s8CA==/lib/arm64, /data/app/~~owVLGPQgutGoiEDD6WPxfA==/com.nikahforever-C9FTciA8_hEg9meOO5s8CA==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]

vivekshindhe commented 1 month ago

@ain-py Hey, the version update resolves another issue in regards with the package package_info_plus.

In regards with the issue with the package smart_auth please refer to this comment