gpt4 book ai didi

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

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:42:35 26 4
gpt4 key购买 nike

我正在开发 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

我的环境

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

那么,我应该怎么做才能解决这个问题呢?

最佳答案

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

ionic 插件添加 cordova-plugin-calendar@4.4.4

关于android - Cordova:无法使用 cordova-plugin-calendar 构建项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36448191/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com