Ad

Flutter Application Stopped Only When Installed Through APK File. How To Fix It?

I had developed a flutter application with Razorpay payment gateway. While I run this app in debug mode, it works fine. And hot reload also works fine. Then I generate apk using flutter build apk command, After installing this application with that apk file. While entering into the Razorpay payment gateway the app stops.

And this same case also occurs in another application also, I'd developed another app with Jitsi video connection setup. While entering the Video connection gateway stops. and of course, this also worked fine in debug and hot reload mode.

I'd found something, app stopes only when Loading com.google.android.webview in my above specified two cases. My log shows that, I/WebViewFactory(pId): Loading com.google.android.webview version XX.X.XXXX.XXX (code codeId)

Ad

Answer

I forgot to add proguard-rules.pro file at android/app. So only these two apps stoped while installed with apk.

For Gitsi - https://github.com/gunschu/jitsi_meet/blob/master/example/android/app/proguard-rules.pro

For Razorpay - https://github.com/razorpay/razorpay-flutter/issues/42

Ad
source: stackoverflow.com
Ad