当我尝试做一个离子cordova构建android时,就会发生这种情况。
Android资源链接失败D:\blabla\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:22: AAPT: error: resource /(又名com.blabla.bla:xml/)未找到。
> BUILD FAILED in 1s D:\blabla\platforms\android\gradlew: Command failed
> with exit code 1 Error output: FAILURE: Build failed with an
> exception.
>
> * What went wrong: Execution failed for task ':app:processDebugResources'.
> > Android resource linking failed D:\blabla\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:22:
> AAPT: error: resource xml/network_security_config (aka
> com.blabla.bla:xml/network_security_config) not found.
>
>
> D:\blabla\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:22:
> AAPT: error: resource mipmap/ic_launcher_round (aka
> com.blabla.bla:mipmap/ic_launcher_round) not found.
>
> error: failed processing manifest.
>
> * 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.
我的androidManifest.xml有这个
<application
android:debuggable="true"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:usesCleartextTraffic="true" >
我的离子信息是这样的,只使用cordova,它不能编译aab格式,也不能编译格式
Ionic:
离子CLI : 6.17.1离子框架:@离子/角5.1.1 @角-devkit/构建角: 0.901.7 @角-devkit/示意图: 9.1.7 @角/cli: 9.1.7 @离子/角-工具包: 2.2.0
电容器:
电容器CLI : 2.1.2 @电容器/android:未安装@电容器/核心: 2.1.2 @电容器/ios:未安装
科多瓦:
Cordova CLI : 10.0.0 ( Cordova -lib@10.1.0) Cordova平台: android 8.1.0 cordova Plugins :cordova-plugin-离子型-键盘2.2.0,cordova-plugin-离子型-webview 5.0.0,(和5个其他插件)
效用:
cordova-res : 0.15.3本地运行: 1.5.0
系统:
Android工具: 26.1.1 NodeJS : v12.14.0 npm : 6.13.4操作系统: Windows 10
config.xml声明为
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:icon="@mipmap/ic_launcher" android:networkSecurityConfig="@xml/network_security_config" android:roundIcon="@mipmap/ic_launcher_round" android:usesCleartextTraffic="true" />
</edit-config>
发布于 2022-07-03 17:17:41
对我来说,这是关于插件版本不兼容的问题,特别是Google服务,它是作为主要插件的支持插件安装的。
删除插件或降级版本解决了这个问题。
最终的解决方案(如果这确实是您的问题)是升级环境(Cordova,Node等)。
https://stackoverflow.com/questions/70790878
复制相似问题