skip to Main Content
android:exported needs to be explicitly specified for element <activity#com.razorpay.CheckoutActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
C:UsersnarayOneDriveDesktopIndiahaatIndiahaatappsrcmainAndroidManifest.xml:12:9-16:20 Error:
    android:exported needs to be explicitly specified for element <receiver#com.razorpay.RzpTokenReceiver>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

I have already tried to resolve this as from android 12 onwards I specify an explicit value for android:exported
So I did likewise for the main and for the other activities and errors started to disappear also,

But in the case of RazorPay activities and Receivers, I am not able to find them in the project’s manifest. I don’t know where are they located so that I can explicitly mark the property of exported.

I am new to payment gateways.

Thanks in advance!!!

4

Answers


  1. Chosen as BEST ANSWER

    Adding this code in the AndroidManifest.xml will override the values of the Razorpay Android SDK and it will work.

    <receiver
        android:name="com.razorpay.RzpTokenReceiver"
        android:exported="false">
        <intent-filter>
            <action android:name="rzp.device_token.share" />
        </intent-filter>
    </receiver>
    
    <activity
        android:name="com.razorpay.CheckoutActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:exported="true"
        android:theme="@style/CheckoutTheme">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <data
                android:host="rzp.io"
                android:scheme="io.rzp" />
        </intent-filter>
    </activity>
    

  2. You can find out the issues in the Merged Manifest and then resolve them. To navigate to the Merged Manifest, follow the steps:

    AndroidManifest.xml -> Merged Manifest tab from the bottom. There you will see any error in Red color. This way you will find your issue and will eventually solve it!

    Login or Signup to reply.
  3. Please update library to a newer version, It’s fixed

    Click here to see the issue on Github

    Login or Signup to reply.
  4. Try updating your androidx.test.ext:junit dependency to 1.1.3 or later. This should solve your problem.

    androidTestImplementation "androidx.test.ext:junit:1.1.3"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search