我一天又一天地在cordova build命令之后出现这个错误。这似乎是由最近发布的 SDK 27 P 预览版引起的错误。这是完整的错误
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':processDebugResources'. com.android.ide.common.process.ProcessException: Failed to execute aaptTry: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Error: cmd: Command failed with exit code 1 Error output: C:\Users...\platforms\android\build\intermediates\res\merged\debug\values-v28\values-v28.xml:7:41-73: AAPT: No resource found that matches the given name (at 'dialog CornerRadius' with value '?android:attr/dialogCornerRadius').
Failed to generate resource table for split '' C:\Users...\platforms\android\build\intermediates\res\merged\debug\values-v28\values-v28.xml:7: error: Error: No resource found that matches the given name (at 'dial ogCornerRadius' with value '?android:attr/dialogCornerRadius').
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':processDebugResources'. com.android.ide.common.process.ProcessException: Failed to execute aapt
我找到了here一种解决问题的方法,但它不能 100% 工作,因为构建结束时没有错误,但我无法在手机上安装 apk,因为需要具有 apiSDK 27 的设备。 唯一的工作方法似乎是将编译 SDK 版本设置为 27+ P 预览,否则会显示错误。
有人知道解决方法或修复它的方法(直接在cordova上或编辑manifest.xml都可以)吗?
最佳答案
我已将以下插件添加到 config.xml 中:
<plugin name="cordova-android-support-gradle-release" source="npm" spec="1.2.0"/>
它解决了问题。
关于android - 错误: No resource found that matches the given name (at 'dial ogCornerRadius' with value '?android:attr/dialogCornerRadius' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49200841/