[英]android:exported needs to be explicitly specified for <activity>
I've explored a lot and i found out that in all the activities we need to specify the android:exported parameter.我进行了很多探索,发现在所有活动中我们需要指定 android:exported 参数。 I've added the param in all my activities in manifest, but i'm still getting this error.
我已在清单中的所有活动中添加了参数,但我仍然收到此错误。
Manifest merger failed: android:exported needs to be explicitly specified for <activity>.
清单合并失败:android:需要为 <activity> 显式指定导出。 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.当相应组件定义了意图过滤器时,需要针对 Android 12 及更高版本的应用程序为
android:exported
指定显式值。 See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.有关详细信息,请参阅https://developer.android.com/guide/topics/manifest/activity-element#exported 。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.soptle">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:roundIcon="@drawable/icon"
android:usesCleartextTraffic="true"
android:supportsRtl="true"
android:theme="@style/Theme.Soptle">
<activity
android:name=".ManufacturerDetailsActivity"
android:exported="true" />
<activity
android:name=".NotificationActivity"
android:exported="true" />
<activity
android:name=".SearchActivity"
android:exported="true" />
<activity
android:name=".UpdateUserInfoActivity"
android:exported="true" />
<activity
android:name=".OTPverificationActivity"
android:exported="true" />
<activity
android:name=".ViewAllActivity"
android:exported="true" />
<activity
android:name=".MyAddressesActivity"
android:exported="true" />
<activity
android:name=".AddAddressActivity"
android:exported="true" />
<activity
android:name=".DeliveryActivity"
android:exported="true" />
<activity
android:name=".OrderDetailsActivity"
android:exported="true" />
<activity
android:name=".ProductDetailsActivity"
android:exported="true" />
<activity
android:name=".CategoryActivity"
android:exported="true" />
<activity
android:name=".HomeActivity"
android:exported="true"
android:label="@string/title_activity_home"
android:screenOrientation="portrait"
android:theme="@style/Theme.Soptle.NoActionBar" />
<activity
android:name=".MainActivity"
android:exported="true"
android:screenOrientation="portrait"
android:theme="@style/Theme.SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".RegisterActivity"
android:exported="true"
android:screenOrientation="portrait" />
<meta-data
android:name="preloaded_fonts"
android:exported="true"
android:resource="@array/preloaded_fonts" />
</application>
</manifest>
adding android:exported="true" to the activity with intent filter in manifest.xml soled the problem for me在清单中使用意图过滤器将 android:exported="true" 添加到活动中。xml 为我解决了问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.