androidcordovaionic-frameworkionic3pushwoosh

Error with Pushwoosh cordova plugin on Ionic


I just installed Pushwoosh cordova plugin on my Ionic project and now I can't run the app on my device to test.

Here are the official docs

If I run: ionic cordova run android --consolelogs --device --livereload

I get:

: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

I don't understand the output.

Any ideas? Thank's in advance!


Solution

  • The problem is simple:

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

    You are using JDK 1.6 while the code of this plugin need to compile on JDK 1.8 or greater.