Cordova:无法使用corodva-plugin-calendar构建项目

时间:2016-04-06 10:20:30

标签: android cordova cordova-plugins android-permissions android-6.0-marshmallow

我正在开发cordova应用程序,我希望通过日历获得某种预订功能。为此,我安装了非常着名的EddyVerbruggen/Calendar-PhoneGap-Plugin插件。

但在构建项目时,它会抛出以下错误

/home/admin/Desktop/myApp/platforms/android/src/nl/xservices/plugins/Calendar.java:148: error: cannot find symbol
      if (PackageManager.PERMISSION_GRANTED != ContextCompat.checkSelfPermission(this.cordova.getActivity(), type)) {
                                                            ^
  symbol:   method checkSelfPermission(Activity,String)
  location: class ContextCompat
/home/admin/Desktop/myApp/platforms/android/src/nl/xservices/plugins/Calendar.java:157: error: cannot find symbol
      ActivityCompat.requestPermissions(
                    ^
  symbol:   method requestPermissions(Activity,String[],int)
  location: class ActivityCompat
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
 FAILED

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.

BUILD FAILED

Total time: 43.228 secs
Error: Error code 1 for command: /home/admin/Desktop/myApp/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/admin/Desktop/myApp/platforms/android/build.gradle,-PcdvBuildArch=x86,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true

我也经历了以下线程......但仍然没有帮助

  1. Android M (6) compatibility
  2. Issue related to the new Cordova version CLI >5
  3. 我的环境

    1. Cordova-CLI:6.1.1
    2. Android-Sdk:23
    3. 那么,我该怎么办才能解决这个问题?

1 个答案:

答案 0 :(得分:4)

更新插件后我遇到了同样的问题。为了节省时间,我刚刚使用了旧版本的插件。

ionic plugin add cordova-plugin-calendar@4.4.4