编译“ant”构建时出错
Posted
技术标签:
【中文标题】编译“ant”构建时出错【英文标题】:Error while compiling "ant" build 【发布时间】:2016-03-06 15:38:21 【问题描述】:最近我在我的科尔多瓦应用程序中安装了cordova-plugin-local-notifications 插件。运行ant debug install
命令时出现以下错误:
-compile:
[javac] Compiling 42 source files to /home/project-path/platforms/android/ant-build/classes
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] /home/project-path/platforms/android/src/de/appplant/cordova/plugin/notification/Options.java:262: error: cannot find symbol
[javac] return NotificationCompat.COLOR_DEFAULT;
[javac] ^
[javac] symbol: variable COLOR_DEFAULT
[javac] location: class NotificationCompat
[javac] /home/project-path/platforms/android/src/de/appplant/cordova/plugin/notification/Builder.java:130: error: cannot find symbol
[javac] .setColor(options.getColor())
[javac] ^
[javac] symbol: method setColor(int)
[javac] location: class Builder
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 errors
[javac] 3 warnings
我有什么遗漏吗?请指教。
【问题讨论】:
【参考方案1】:通过将android-support-v4.jar
添加到应用程序解决了这个问题。
【讨论】:
以上是关于编译“ant”构建时出错的主要内容,如果未能解决你的问题,请参考以下文章
如何在 Ant 构建任务中使用 -Xlint:unchecked 重新编译?