【问题标题】:How to run cordova build with -Xlint:deprecation如何使用 -Xlint:deprecation 运行 cordova build
【发布时间】:2015-10-21 08:52:35
【问题描述】:

在构建我的插件时

cordova build

Cordova 报告我的插件正在使用弃用 API,我应该了解更多信息

Recompile with -Xlint:deprecation for details.

但是如何将 -Xlint:deprecation 作为参数传递给 cordova build?

【问题讨论】:

    标签: cordova cordova-plugins


    【解决方案1】:

    我认为这是与 Android 构建相关的问题,您可以尝试禁用 Xlint:deprecation 标志,如post 中所述

    1. 转到 $ANDROID_SDK_ROOT/tools/ant/main_rules.xml 文件并复制 “编译”目标。
    2. 将其粘贴到任务之前的 build.xml 文件中。
    3. 然后将以下元素添加到任务中:<compilerarg value="-Xlint:deprecation"/>
    4. 同样,您可以添加其他编译器选项,例如用于未检查的操作:<compilerarg value="-Xlint:unchecked"/>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-23
      • 1970-01-01
      • 1970-01-01
      • 2021-01-13
      • 2019-06-08
      • 1970-01-01
      • 2013-10-10
      • 2011-12-02
      相关资源
      最近更新 更多