You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The plugin.xml file of [EDIT: https://github.com/Steffaan/cordova-plugin-local-notifications ] contains the line: <engine name="android-sdk" version=">=26" />
This plugin refused to install on the Nevercode CI platform even though android-29 was installed, because I discovered that (at the time, at least) their build environments have three Android Preview SDKs installed.
The issue is that when android_sdk.js encounters an SDK version without a number at the end (in my case, android-P, android-Q, and android-R), it refuses to move it, and depending on where it is in relation to other versions, it can block proper sorting of the SDKs.
What is expected to happen?
Plugin should install since a version of the SDK is installed matching the requirements.
What does actually happen?
Plugin did not install.
Information
Attempt to build a project with the cordova-plugin-local-notifications plugin (or any other with a similar requirement) with Android Preview SDKs installed.
Command or Code
Here's a patch that, instead of not moving the preview versions at all, gives them a version of 0 so they get sent to the end of the list.
--- android_sdk.js 2020-05-26 14:33:04.000000000 -0400
+++ android_sdk_new.js 2020-05-26 14:50:38.000000000 -0400
@@ -31,15 +31,12 @@
function sort_by_largest_numerical_suffix (a, b) {
var suffix_a = a.match(suffix_number_regex);
var suffix_b = b.match(suffix_number_regex);
- if (suffix_a && suffix_b) {
- // If the two targets being compared have suffixes, return less than
- // zero, or greater than zero, based on which suffix is larger.
- return (parseInt(suffix_a[1]) > parseInt(suffix_b[1]) ? -1 : 1);
- } else {
- // If no suffix numbers were detected, leave the order as-is between
- // elements a and b.
- return 0;
- }
+ // If no number is detected (eg: preview version like android-R),
+ // designate a suffix of 0 so it gets moved to the end
+ suffix_a = suffix_a ? suffix_a : ['0','0'];
+ suffix_b = suffix_b ? suffix_b : ['0','0'];
+ // Return < zero, or > zero, based on which suffix is larger.
+ return (parseInt(suffix_a[1]) > parseInt(suffix_b[1]) ? -1 : 1);
}
module.exports.print_newest_available_sdk_target = function () {
Perhaps the preview SDKs would be given a proper number, but that's more complicated than what I needed. Either way, it was causing my plugin install to fail on Nevercode. Due to the ordering of the installed SDKs, 15 got moved to the front instead of 29.
Sorry I didn't submit a pull request, but I'm not sure how to properly meet the required testing criteria with a bug like this.
Environment, Platform, Device
Nevercode CI with what looked like every Android SDK in existence installed
Bug Report
Problem
The plugin.xml file of [EDIT: https://github.com/Steffaan/cordova-plugin-local-notifications ] contains the line:
<engine name="android-sdk" version=">=26" />
This plugin refused to install on the Nevercode CI platform even though android-29 was installed, because I discovered that (at the time, at least) their build environments have three Android Preview SDKs installed.
The issue is that when android_sdk.js encounters an SDK version without a number at the end (in my case, android-P, android-Q, and android-R), it refuses to move it, and depending on where it is in relation to other versions, it can block proper sorting of the SDKs.
What is expected to happen?
Plugin should install since a version of the SDK is installed matching the requirements.
What does actually happen?
Plugin did not install.
Information
Attempt to build a project with the cordova-plugin-local-notifications plugin (or any other with a similar requirement) with Android Preview SDKs installed.
Command or Code
Here's a patch that, instead of not moving the preview versions at all, gives them a version of 0 so they get sent to the end of the list.
Perhaps the preview SDKs would be given a proper number, but that's more complicated than what I needed. Either way, it was causing my plugin install to fail on Nevercode. Due to the ordering of the installed SDKs, 15 got moved to the front instead of 29.
Sorry I didn't submit a pull request, but I'm not sure how to properly meet the required testing criteria with a bug like this.
Environment, Platform, Device
Nevercode CI with what looked like every Android SDK in existence installed
Version information
Cordova CLI 9.0.0
Cordova-Android 8.1.0
Ionic 3.20.1
Checklist
The text was updated successfully, but these errors were encountered: