Incompatiblity with older android versions
See original GitHub issueIt looks like since this commit here (6b522e9832ba2dcd40b3820d9900db07a29b8aa0), some specific java features that are only enabled in android 7 and 8 were added (like Lambdas). This breaks the plugin on apps that still support android 6.
Would it be possible to amend the lambdas and other android 7 and 8 specific features to keep compatibility with android 6?
Here’s an example of some of the build errors:
/Users/buddy.reno/webapps/tdrs-app/tdrs-ionic-app/platforms/android/src/de/appplant/cordova/plugin/background/BackgroundMode.java:96: error: strings in switch are not supported in -source 1.6
[cordova] switch (action)
[cordova] ^
[cordova] (use -source 7 or higher to enable strings in switch)
[cordova] /Users/buddy.reno/webapps/tdrs-app/tdrs-ionic-app/platforms/android/src/de/appplant/cordova/plugin/background/BackgroundModeExt.java:260: error: method references are not supported in -source 1.6
[cordova] activity.runOnUiThread(dialog::show);
[cordova] ^
[cordova] (use -source 8 or higher to enable method references)
[cordova] /Users/buddy.reno/webapps/tdrs-app/tdrs-ionic-app/platforms/android/src/de/appplant/cordova/plugin/background/BackgroundModeExt.java:242: error: lambda expressions are not supported in -source 1.6
[cordova] dialog.setPositiveButton(ok, (o, d) -> activity.startActivity(intent));
[cordova] ^
[cordova] (use -source 8 or higher to enable lambda expressions)
[cordova] /Users/buddy.reno/webapps/tdrs-app/tdrs-ionic-app/platforms/android/src/de/appplant/cordova/plugin/background/BackgroundMode.java:295: error: lambda expressionsare not supported in -source 1.6
[cordova] cordova.getActivity().runOnUiThread(() -> webView.loadUrl("javascript:" + js));
[cordova] ^
[cordova] (use -source 8 or higher to enable lambda expressions)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:11
Top Results From Across the Web
Device compatibility overview - Android Developers
Each successive version of Android provides compatibility for apps that were built using the APIs from previous platform versions, so your app should...
Read more >Why do apps stop supporting older Android versions after ...
To maintain compatibility across major versions differences of Android, multiple versions of the app may have to be maintained and distributed ...
Read more >How to Install Incompatible Apps on Android in 2022? - MrNoob
Method 1: Installing incompatible Android apps by sideloading APK. Sideloading APKs of incompatible apps is a widespread practice among Android ...
Read more >Top 5 Ways to Fix 'Your Device Isn't Compatible with This ...
3. Uninstall Play Store Updates. A recent Play Store update might have messed up version compatibility on your Android phone. It's time to ......
Read more >FIX: “Your Device Isn't Compatible with This Version” on Android
The error appears when the Play Store thinks your device isn't compatible with the app you're trying to download. This doesn't mean that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Feel free to fork my fork. Adds support for older Cordova versions.
Still i’m facing the same issue in Cordova-Android 6.4.0. The automated builds won’t work with the above fix. is there any thing we can do now? if we don’t use the URL (https://github.com/katzer/cordova-plugin-background-mode.git) to install this plugin then the plugin works fine in Android but iOS build is crashed when open the app, might be due to a key change done in this plugin a year ago.
Now using this URL the plugin works fine in iOS but android build is not passing. Please let us know if we can make some workaround to both platform with a fix?