Android Studio 清单合并失败,出现多个错误,请在将项目迁移到android 12后查看日志

piah890a  于 2022-11-25  发布在  Android
关注(0)|答案(3)|浏览(237)
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.

我已经尝试解决这个问题,因为从android 12起,我为android指定了一个显式值:导出所以我也为main和其他活动做了同样的事情,错误也开始消失,
但在RazorPay活动和接收器的情况下,我无法在项目清单中找到它们。我不知道它们位于何处以便明确标记导出的属性

我不熟悉支付网关。

提前感谢!!!

a0x5cqrl

a0x5cqrl1#

您可以找出Merged Manifest中的问题,然后加以解决。若要浏览至Merged Manifest,请遵循下列步骤:
AndroidManifest.xml-〉Merged Manifest标签页。在那里你会看到Red color中的任何错误。没有你的清单,我无法解决你的问题。但我肯定可以给你一个线索

ohtdti5x

ohtdti5x3#

AndroidManifest.xml中添加此代码将覆盖Razorpay Android SDK的值,它将工作。

<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>

相关问题