Android Build Error with Background Mode

Hi
I am trying to use the katzer Background Mode Plugin as recommended by Appery. I get the following APK build error

Build error

Most likely build error cause:

/app/platforms/android/src/de/appplant/cordova/plugin/background/BackgroundMode.java:295: error: lambda expressions are not supported in -source 1.6
cordova.getActivity().runOnUiThread(() -> webView.loadUrl("javascript:" + js));
^
(use -source 8 or higher to enable lambda expressions)
/app/platforms/android/src/de/appplant/cordova/plugin/background/BackgroundModeExt.java:168: error: lambda expressions are not supported in -source 1.6
getApp().runOnUiThread(() -> {
^
(use -source 8 or higher to enable lambda expressions)
/app/platforms/android/src/de/appplant/cordova/plugin/background/BackgroundModeExt.java:257: error: method references are not supported in -source 1.6
activity.runOnUiThread(dialog::show);
^
(use -source 8 or higher to enable method references)
3 errors
:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.
(node:3488) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /app/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/app/platforms/android/src/de/appplant/cordova/plugin/background/BackgroundMode.java:295: error: lambda expressions are not supported in -source 1.6
cordova.getActivity().runOnUiThread(() -> webView.loadUrl("javascript:" + js));
^
(use -source 8 or higher to enable lambda expressions)
/app/platforms/android/src/de/appplant/cordova/plugin/background/BackgroundModeExt.java:168: error: lambda expressions are not supported in -source 1.6
getApp().runOnUiThread(() -> {
^
(use -source 8 or higher to enable lambda expressions)
/app/platforms/android/src/de/appplant/cordova/plugin/background/BackgroundModeExt.java:257: error: method references are not supported in -source 1.6
activity.runOnUiThread(dialog::show);
^
(use -source 8 or higher to enable method references)
3 errors

FAILURE: Build failed with an exception.
1 person has
this problem
+1
Reply