Manifest merger failed with multiple errors, see logs after migrating the project to android 12
Asked Answered
M

4

5
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:\Users\naray\OneDrive\Desktop\Indiahaat\Indiahaat\app\src\main\AndroidManifest.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!!!

Mastaba answered 23/3, 2022 at 9:30 Comment(0)
S
12

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!

Sanctify answered 23/3, 2022 at 9:36 Comment(5)
I already mentioned the manifest merger error already, but I don't know how to resolve it. That's a very clear point I made. _Mastaba
Is exported set to true or false?Sanctify
There was no sign of razorpay.CheckoutActivity and Receiver in my manifest. If It had then obviously I have made some changes to check what works or what not.Mastaba
I ran into the same issue, and setting the exported to True solved it. But why the exported has to be set to True? This makes the activity exposed, and is not recommendedRolfrolfe
Ok, by adding tools:ignore="IntentFilterExportedReceiver", then the exported does not need to set to trueRolfrolfe
K
10

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"
Karenkarena answered 1/3, 2023 at 1:22 Comment(0)
M
1

Please update library to a newer version, It's fixed

Click here to see the issue on Github

Missis answered 23/3, 2022 at 9:38 Comment(2)
these kinds of informations are preferred to be given in commentsSanctify
thanks @Cường Nguyễn you pointed at the right Solution.Mastaba
M
0

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>
Mastaba answered 23/3, 2022 at 17:18 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.