安卓报错:Manifest merger failed : android:exported needs to be explicitly specified for element

解决安卓报错:Manifest merger failed : android:exported needs to be explicitly specified for element <activity#com.team.sportsskuyy.MainActivity>. 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.

image-20230710162434953

将Manifest中有配置Intent-filter的Activity加上android:exported属性

image-20230710162526590

<activity
    android:name=".MainActivity"
    android:screenOrientation="portrait"
    android:theme="@style/AppTheme.NoActionBar"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

猜你喜欢

转载自blog.csdn.net/m0_63324772/article/details/131642256