简体   繁体   English

清单合并失败:需要明确指定 android:exported<activity>

[英]Manifest merger failed : android:exported needs to be explicitly specified for <activity>

I have a problem with a manifest file, error message:我的清单文件有问题,错误消息:

Manifest merger failed : android: exported needs to be explicitly specified for .清单合并失败:android:需要为 明确指定导出。 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指定显式值,当相应的组件定义了意图过滤器时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。

My AndroidManifest:我的AndroidManifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapp">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.MyTheme">
        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:exported="true"
            android:name=".Activities.SplashScreenActivity"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar">
        </activity>
    </application>

</manifest>

This post describes a solution but it doesn't work or I made something wrong.这篇文章描述了一个解决方案,但它不起作用或者我做错了。 Maybe anyone has a similar problem, please let me know how to resolve that.也许有人有类似的问题,请告诉我如何解决。

  1. downgrade or upgrade to a prior sdk version then rebuild the project.降级或升级到之前的 sdk 版本,然后重建项目。
  2. open your project's AndroidManifest.xml .打开项目的AndroidManifest.xml
  3. click on the Merged Manifest tab [at the bottom of the window]单击“合并清单”选项卡 [在窗口底部]
  4. find out which <activity> that includes an <intent-filter> tag is missing the android:exported attribute找出包含<intent-filter>标签的哪个<activity>缺少android:exported属性
  5. if found then right-click and press Go to Declaration then add android:exported attribute如果找到则右键单击并按Go to Declaration然后添加android:exported属性
  6. Rebuild the project重建项目

Hope it will work.希望它会起作用。 It works for me.这个对我有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Manifest合并失败:android:exported needs to be explicitly specified for<receiver></receiver> - Manifest merger failed : android:exported needs to be explicitly specified for <receiver> 清单合并失败:需要为元素显式指定 android:exported <service#com.marianhello.bgloc.sync.authenticatorservice></service#com.marianhello.bgloc.sync.authenticatorservice> - Manifest merger failed : android:exported needs to be explicitly specified for element <service#com.marianhello.bgloc.sync.AuthenticatorService> 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 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 merger failed with multiple errors, see logs But I Already Use Exported in Every Activity Android Studio) 清单合并失败 - Android Studio) Manifest Merger Failed Android-错误清单合并失败 - Android - Error Manifest merger failed "我设置了 android:exported 但我仍然收到错误:android:exported 需要明确指定<receiver>" - I set android:exported but I am still getting error: android:exported needs to be explicitly specified for <receiver> android:exported 需要明确指定<receiver> . 在 Flutter 中面向 Android 12 及更高版本的应用 - android:exported needs to be explicitly specified for <receiver>. Apps targeting Android 12 and higher In Flutter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM