【发布时间】:2017-05-17 23:50:18
【问题描述】:
将 cordova 相机插件从 2.1.1 更新到 2.3.1 后,我遇到了构建错误。
版本详情:
cordova version: 6.3.1,
cordova-plugin-camera 2.1.1 "Camera"
我在做什么:
cordova plugin remove cordova-plugin-camera --save
cordova plugin add cordova-plugin-camera --save
我看到 config.xml 文件已更新为:
<plugin name="cordova-plugin-camera" spec="~2.3.1" />
当我构建 cordova android build 时出现以下错误:
Error: cmd: Command failed with exit 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.
warning: string 'menu_settings' has no default translation.
platforms\android\src\org\apache\cordova\camera\CameraLauncher.java:32:
error: cannot find symbol
import org.apache.cordova.BuildHelper;
symbol: class BuildHelper
location: package org.apache.cordova
platforms\android\src\org\apache\cordova\camera\CameraLauncher.java:140:
error: cannot find symbol
this.applicationId = (String)
BuildHelper.getBuildConfigValue(cordova.getActivity(), "APPLICATION_ID");
^
symbol: variable BuildHelper
location: class CameraLauncher
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
【问题讨论】:
-
在构建它之前,您是否尝试过删除并重新添加 Android 平台一次?希望这能解决问题
标签: android cordova ionic-framework cordova-plugins