Ionic 上的 Pushwoosh cordova 插件出错

Error with Pushwoosh cordova plugin on Ionic

我刚刚在我的 Ionic 项目上安装了 Pushwoosh cordova plugin,现在我无法 运行 在我的设备上测试该应用程序。

这里是官方docs

如果我运行: ionic cordova run android --consolelogs --device --livereload

我得到:

:compileDebugJavaWithJavac
/media/ivan/SharedPartition/Trabajo/AnimaEdu/animaedu-mobile/platforms/android/src/com/pushwoosh/plugin/pushnotifications/PushNotifications.java:888: error: lambda expressions are not supported in -source 1.6

            mainHandler.post(() -> webView.loadUrl("javascript:"+ url));
                                ^
  (use -source 8 or higher to enable lambda expressions)
1 error
 FAILED
27 actionable tasks: 1 executed, 26 up-to-date

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.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s
(node:18368) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /media/ivan/SharedPartition/Trabajo/AnimaEdu/animaedu-mobile/platforms/android/gradlew: Command failed with exit code 1 Error output:
/media/ivan/SharedPartition/Trabajo/AnimaEdu/animaedu-mobile/platforms/android/src/com/pushwoosh/plugin/pushnotifications/PushNotifications.java:888: error: lambda expressions are not supported in -source 1.6
            mainHandler.post(() -> webView.loadUrl("javascript:"+ url));
                                ^
  (use -source 8 or higher to enable lambda expressions)
1 error

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.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s

我不明白输出。

有什么想法吗?提前致谢!

问题很简单:

Error cause --> lambda expressions are not supported in -source 1.6

您正在使用 JDK 1.6,而此插件的代码需要在 JDK 1.8 或更高版本上编译。