
[英]Build error after adding Crosswalk plugin to a Cordova Android project
[英]cordova 8.0.0 build failed after add crosswalk plugin
请帮忙。 为什么在添加crosswalk webview插件后,cordova cli构建总是失败? 无论我使用什么版本的Android平台,我都尝试使用cordova android@5.1.1,6.2.3,6.3.0,7.0.0 ..但是没有这个插件就成功了。 这很奇怪,因为我在4月份取得了成功,但现在得到错误并且无法构建..我正在卸载并安装node.js,git,cordova ..同样的项目在人行横道上成功,我再次构建并获得错误结果..也失败了..
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processArmv7ReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --
debug
option to get more log output.
BUILD FAILED
Total time: 2 mins 47.283 secs
(node:5976) UnhandledPromiseRejectionWarning: Error: cmd: Command failed
with ex
it code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
D:\\ 5.GAME \\ Cordova \\ 4keempat \\ Gardam \\ platforms \\ android \\ build \\ intermediates \\ manifest \\ full \\ armv7 \\ release \\ AndroidManifest.xml:24:AAPT:找不到包''中属性'appComponentFactory'的资源标识符android'D:\\ 5.GAME \\ Cordova \\ 4keempat \\ Gardam \\ platforms \\ android \\ build \\ intermediates \\ manifest \\ full \\ armv7 \\ release \\ AndroidManifest.xml:24:error:找不到属性'appComponentFactory'的资源标识符包'android'
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processArmv7ReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --
debug
option to get more log output.
at ChildProcess.whenDone (D:\5.GAME\Cordova\4keempat\Gardam\platforms\androi
d\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
(node:5976) UnhandledPromiseRejectionWarning: Unhandled promise rejection.
This
error originated either by throwing inside of an async function without a
catch
block, or by rejecting a promise which was not handled with .catch().
(rejection
id: 1)
(node:5976) [DEP0018] DeprecationWarning: Unhandled promise rejections are
deprecated. In the future, promise rejections that are not handled will
terminate the Node.js process with a non-zero exit code.
有什么问题?
我们有同样的问题,并能够通过添加以下代码块来解决它:platform / android / build.gradle:
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:24.0.0'
}
}
可以使用钩子来完成它,如下所述: https : //github.com/crosswalk-project/cordova-plugin-crosswalk-webview/issues/205#issuecomment-371797767
Cordova插件使用不同版本的Android支持库发生错误。 cordova-android-support-gradle-release可以帮助你强迫他们使用相同的版本。
添加cordova-android-support-gradle-release
然后,添加config.xml
<plugin name="cordova-android-support-gradle-release" spec="^1.4.3">
<variable name="ANDROID_SUPPORT_VERSION" value="26.+" />
</plugin>`
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.