在 cordova 12.0.0 中构建时 processReleaseMainManifest 失败

问题描述 投票:0回答:2

请帮忙 我在科尔多瓦 12.0.0 中运行 cordova 构建 android --release ---packageType=bundle 并构建失败 这里

Checking Java JDK and Android SDK versions
ANDROID_HOME=C:\Users\xxx\AppData\Local\Android\Sdk (recommended setting)
ANDROID_SDK_ROOT=undefined (DEPRECATED)
Using Android SDK: C:\Users\xxx\AppData\Local\Android\Sdk
Subproject Path: CordovaLib
Subproject Path: app

> Task :app:processReleaseMainManifest FAILED
E:\xxx\platforms\android\app\src\main\AndroidManifest.xml:12:9-16:20 Error:
        android:exported needs to be explicitly specified for element <receiver#com.tonikorin.cordova.plugin.autostart.BootCompletedReceiver>. 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:\xxx\platforms\android\app\src\main\AndroidManifest.xml:17:9-21:20 Error:
        android:exported needs to be explicitly specified for element <receiver#com.tonikorin.cordova.plugin.autostart.UserPresentReceiver>. 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:\xxx\platforms\android\app\src\main\AndroidManifest.xml:22:9-26:20 Error:
        android:exported needs to be explicitly specified for element <receiver#com.tonikorin.cordova.plugin.autostart.PackageReplacedReceiver>. 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.

See https://developer.android.com/r/studio-ui/build/manifest-merger for more information about the manifest merger.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseMainManifest'.
> Manifest merger failed with multiple errors, see logs

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1s
12 actionable tasks: 1 executed, 11 up-to-date
Command failed with exit code 1: E:\xxx\platforms\android\gradlew -b E:\xxx\platforms\android\build.gradle :app:bundleRelease

还有其他帮手吗?哟?

我使用gradle 7.6,然后更新到8.0 我看到 cordova 12.0.0 依赖项中的以下项目已被取消:

科特林:21.7.1 等级:7.6 Android Gradle 插件 (AGP):7.4.2 谷歌服务 Gradle 插件:4.3.15 AndroidX 应用程序兼容库:1.6.1 AndroidX WebKit 库:1.6.0 AndroidX SplashScreen 核心库:1.0.0

cordova cordova-plugins
2个回答
0
投票

这是您粘贴的错误。合并 Manifest 时需要更新插件

com.tonikorin.cordova.plugin.autostart
以设置
android:exported
,因为它使用
intent-filter

面向 Android 12 及更高版本的应用需要指定 当对应组件时,

android:exported
的显式值 定义了一个意图过滤器。看 https://developer.android.com/guide/topics/manifest/activity-element#exported 了解详情。


-1
投票

这是我的 AndroidManifest

<?xml version='1.0' encoding='utf-8'?>

这有什么问题吗?

© www.soinside.com 2019 - 2024. All rights reserved.