添加Crosswalk插件后,Cordova 8.0.0构建失败

3
请帮忙。为什么在添加Crosswalk WebView插件后,Cordova CLI构建总是失败?无论我使用什么版本的Android平台,我都尝试了Cordova Android @ 5.1.1、6.2.3、6.3.0、7.0.0等版本,但没有这个插件则可以成功构建。很奇怪,因为我在四月份成功了,但现在却出现错误并且构建失败了。 我已经卸载和安装了node.js、git、cordova.. 我再次构建跟之前用Crosswalk成功的同一个项目,但现在也失败了。
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 s\full\armv7\release\AndroidManifest.xml:24: AAPT在包'android'中没有找到'AppComponentFactory'属性的资源标识符。 D:\5.GAME\Cordova\4keempat\Gardam\platforms\android\build\intermediates\manifest s\full\armv7\release\AndroidManifest.xml:24: 错误:在包'android'中未找到'appComponentFactory'属性的资源标识符。

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.

什么是问题?

遇到相同的问题。 但我需要重新安装我的电脑,保存了所有东西(整个代码库) 仍然遇到这个问题。 降级 cordova 也没有帮助。 - graphefruit
3个回答

12

哇,它工作了!另一个评论建议“更改”,让我感到困惑。现在我知道必须“添加”。 - Marcelinus Wahyu
非常感谢!工作得很好。 - graphefruit
我今天在一个之前已经编译过的项目中发现了这个错误。你有什么想法,为什么会出现这种情况? - Pharylon

4

1

添加 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>` 

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接