Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova:Unable to build project with corodva-plugin-calendar

Tags:

I'm developing the cordova application, in which I want to have some kind of booking functionality through calendar. So for that, I installed very famous EddyVerbruggen/Calendar-PhoneGap-Plugin plugin.

But while building the project, it's throwing following error

/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

I also gone through following threads..but still no help

  1. Android M (6) compatibility
  2. Issue related to the new Cordova version CLI >5

My Environment

  1. Cordova-CLI : 6.1.1
  2. Android-Sdk : 23

So, what should I do to resolve this issue?

like image 637
Ricky Avatar asked Apr 06 '16 10:04

Ricky


1 Answers

I had the same problem after updating my plugins. To save time, I just used an older version of the plugin.

ionic plugin add [email protected]

like image 185
Asad Palekar Avatar answered Sep 28 '22 02:09

Asad Palekar