Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

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.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Android Build Error with Background Mode

Hello Deon,

It seems you use the version of that plugin, based on ES6, but Appery.io supports ES5. Please check the previous version of that plugin.

Return to “Issues”