I have completed the application with flutter and tried in the simulator where everything works fine. But when I build the apk file using flutter build apk command an app-release.apk builds up. When I installed the app-release.apk in the mobile the it runs but When I press the payment button ( which is using razorpay api) then the app suddenly stops working (but works fine in mobile simulator and also when actual mobile is kept as an emulator) the emulator mobile device is of Pixel 2 API 28. I have tried using

I tried adding mavenCentral() to app level build.gradle and compile razorpay:checkout dependency

Solution 1: user14596272

To use razorpay api you need internet connection. In emulator it comes by default so it works but for it to work on actual mobiles you need to add the following permissions in AndroidMainfest.xml. Procedure is as below..

Step 1: Go to android\app\src\main\AndroidManifest.xml

Step 2: Copy this line below:

<uses-permission android:name="android.permission.INTERNET" />

Step 3: Put it in AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    <uses-permission android:name="android.permission.INTERNET" /> 

        <activity android:name=".HelloWorldActivity">
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />


Step 4: Rebuild the the .apk and try on mobile it should work.