Android SDK Migration to Latest Version

Current Latest Version: 2.4.1

Step 1: Replacing the Dependencies

Replace old dependencies with the following dependencies:

implementation ''

Step 2: Remove all meta-data tags

Remove all meta-data tags (related to PhonePe payment SDK).

Before removing meta-data tags

Note down the values in & meta-data tag.

The following meta-data tags might be present in 2.1.1 or older SDKs:

<meta-data android:name="" android:value="true"/> 
<meta-data android:name="" android:value="true"/>
<meta-data android:name="" android:value="merchantId"/> 
<meta-data android:name="" android:value="appId"/>

Step 3: Replace the old init method

Old PhonePe init syntax

 PhonePe.init(Context context)

Replace with the new PhonePe init syntax

PhonePe.init(Context context,PhonePeEnvironment environment,String merchantId, String appId)


  • String environment can be
    • PhonePeEnvironment.PRODUCTION
    • PhonePeEnvironment.SANDBOX
  • String merchantId = value in tag.
  • String appId = value in tag.

PhonePe.init(context, PhonePeEnvironment.UAT, ”REPLACE_WITH_YOUR_MID”, “REPLACE_WITH_YOUR_APP_ID”)