我的清单文件有问题,错误消息:
Manifest合并失败:android:exported需要明确指定为.当相应组件定义了意图过滤器时,面向 Android 12 及更高版本的应用需要为
指定显式值。有关详细信息,请参阅 https://developer.android.com/guide/topics/manifest/activity-element#exported。android: exported
我的 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>
这篇post描述了一个解决方案,但它不起作用或者我做错了一些事情。也许有人有类似的问题,请告诉我如何解决。
AndroidManifest.xml
。<activity>
标签的哪个 <intent-filter>
缺少 android:exported
属性Go to Declaration
然后将 android:exported
属性添加到活动标签希望它会起作用。它对我有用。
与第一个答案相关,我可以在第 5 步中添加: