简体   繁体   English

android:exported 需要明确指定<activity></activity>

[英]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.

相关问题 android:exported 需要明确指定<activity></activity> - android:exported needs to be explicitly specified for <activity> android:exported 需要明确指定<activity> . 针对 Android 12 的应用程序?</activity> - android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12? android:exported需要明确指定 - android:exported needs to be explicitly specified 清单合并失败:需要明确指定 android:exported<activity> - Manifest merger failed : android:exported needs to be explicitly specified for <activity> AndroidManifest 错误:android:exported 需要明确指定<activity></activity> - AndroidManifest error: android:exported needs to be explicitly specified for <activity> android:exported 需要明确指定<service></service> - android:exported needs to be explicitly specified for <service> `android:exported 需要明确指定<activity> ` 即使我已经指定了它</activity> - `android:exported needs to be explicitly specified for <activity>` even though I have specified it android:exported 需要明确指定<activity> . 针对 Android 12 及更高版本的应用需要指定</activity> - android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify android:exported 需要明确指定<service> . 针对 Android 12 的应用程序</service> - android:exported needs to be explicitly specified for <service>. Apps targeting Android 12 Manifest合并失败:android:exported needs to be explicitly specified for<receiver></receiver> - Manifest merger failed : android:exported needs to be explicitly specified for <receiver>
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM