razorpay / razorpay-flutter

Razorpay Flutter Plugin
MIT License
107 stars 147 forks source link

App crashes in release but works fine in debug mode. #48

Closed sharathGowda12 closed 4 years ago

sharathGowda12 commented 4 years ago

This problem with solution is mentioned already in issue https://github.com/razorpay/razorpay-flutter/issues/42

However the solution didn't work for me.

App works fine (even without proguard rules) with flutter run --release but once we build apk & run the app, it didn't work

here is build gradle

buildTypes {
        release {            
            signingConfig signingConfigs.release
            //shrinkResources true
            //minifyEnabled true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),  'proguard-rules.pro' 
        }
    }

Here is the Proguard rules

-keepclassmembers class * {
@android.webkit.JavascriptInterface ;
}
-keepattributes JavascriptInterface
-keepattributes Annotation
-dontwarn com.razorpay.**
-keep class com.razorpay.** {;}
-optimizations !method/inlining/
-keepclasseswithmembers class * {
public void onPayment*(...);
}

I even tried by removing proguard rules, read & tried all the razorpay official documents, but still the app crashes.

Any workaround is highly appreciated.

shashikantshaale commented 4 years ago

I'm facing same issue

shashikantshaale commented 4 years ago

I followed #42 , it worked.

Thank you @sharath12345678

Nautiyalsachin commented 4 years ago

Closing this issue due to the time elapsed. Please feel free to either re-open the issue or create a new issue if you have any additional queries.

arshadm25 commented 4 years ago

This problem with solution is mentioned already in issue #42

However the solution didn't work for me.

App works fine (even without proguard rules) with flutter run --release but once we build apk & run the app, it didn't work

here is build gradle

buildTypes {
        release {            
            signingConfig signingConfigs.release
            //shrinkResources true
            //minifyEnabled true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),  'proguard-rules.pro' 
        }
    }

Here is the Proguard rules

-keepclassmembers class * {
@android.webkit.JavascriptInterface ;
}
-keepattributes JavascriptInterface
-keepattributes Annotation
-dontwarn com.razorpay.**
-keep class com.razorpay.** {;}
-optimizations !method/inlining/
-keepclasseswithmembers class * {
public void onPayment*(...);
}

I even tried by removing proguard rules, read & tried all the razorpay official documents, but still the app crashes.

Any workaround is highly appreciated.

I am facing the same issue even the propguard rules added

sharathGowda12 commented 4 years ago

@arshadm25 Try this, minifyEnabled false

it worked for me.

arshadm25 commented 4 years ago

thanks for your reply i will check that once and let you know

On Tue, 24 Mar 2020 at 09:07, sharath12345678 notifications@github.com wrote:

@arshadm25 https://github.com/arshadm25 Try this, minifyEnabled false

it worked for me.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/razorpay/razorpay-flutter/issues/48#issuecomment-602994839, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEVJTL34ACOZTZFIL4WFTPLRJATJJANCNFSM4KOYRHQA .

-- Muhammed Arshad M

9544933392 | muhammedarshadm@gmail.com

Skype: arshadm25 <#SignatureSanitizerSafeHtmlFilter> Muthangayil House, Mulliyakurssi,Pattikkad P.O,Malappuram,Kerala - 679325 http://www.facebook.com/muhdarshadm http://www.linkedin.com/in/muhammed-arshad-m-5ab7a5b7/ http://twitter.com/muhammedarshadm Create your own email signature https://www.wisestamp.com/signature-in-email?utm_source=promotion&utm_medium=signature&utm_campaign=create_your_own

arshadm25 commented 4 years ago

@arshadm25 Try this, minifyEnabled false

it worked for me.

thanks bro it worked for me but i had to set shrinkResources false also

sanjeevkse commented 4 years ago

@arshadm25 Try this, minifyEnabled false

it worked for me.

This worked for me too. After so many days of struggle. Thank you so much.

vinothvino42 commented 4 years ago

@arshadm25 Try this, minifyEnabled false

it worked for me.

Thank you so much! It worked for me.

achieverprince commented 3 years ago

It is strange for me Dev mode crashes (even app start) But --variant=release works fine

mitalpatel5944 commented 3 years ago

not working. why these issue closed ?

achieverprince commented 3 years ago

after gradlew clean and increasing minsdk to android 5 worked, it worked.

rohitbarge commented 1 year ago

I am getting this

No signature of method: build_amwhym3pk76xdwrm3lwmfm5m.android() is applicable for argument types: (build_amwhym3pk76xdwrm3lwmfm5m$_run_closure2) values: [build_amwhym3pk76xdwrm3lwmfm5m$_run_closure2@47532e3]

on follow above steps