uniapp 离线打包报错 Task :simpleDemo:processDebugMainManifest FAILED
Task :simpleDemo:processDebugMainManifest FAILED E:\uniappPack\4.36\HBuilder-Integrate-AS\simpleDemo\src\main\AndroidManifest.xml:11:9-24:20 Error: android:exported needs to be explicitly specified for element <activity#io.dcloud.PandoraEntry>. 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. E:\uniappPack\4.36\HBuilder-Integrate-AS\simpleDemo\src\main\AndroidManifest.xml:25:9-40:20 Error: android:exported needs to be explicitly specified for element <activity#io.dcloud.PandoraEntryActivity>. 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.
打开 E:\uniappPack\4.36\HBuilder-Integrate-AS\simpleDemo\src\main\AndroidManifest.xml 文件。
找到 io.dcloud.PandoraEntry 和 io.dcloud.PandoraEntryActivity 的 Activity 声明,并为它们添加 android:exported 属性。
<activity
android:name="io.dcloud.PandoraEntry"
android:exported="true" <!-- 添加这一行 -->
... >
<intent-filter>
... <!-- 原有的 intent-filter 内容 -->
</intent-filter>
</activity>
<activity
android:name="io.dcloud.PandoraEntryActivity"
android:exported="true" <!-- 添加这一行 -->
... >
<intent-filter>
... <!-- 原有的 intent-filter 内容 -->
</intent-filter>
</activity>
打包教程:
https://blog.csdn.net/qq_40230735/article/details/123346723

浙公网安备 33010602011771号