ionic-team / legacy-ionic-cloud

JavaScript Client for legacy Ionic Cloud services. See Ionic Pro for our new take on the ionic development lifecycle
Apache License 2.0
65 stars 26 forks source link

Deploy in ionic2 never finds a new version but is greeted with IONIC.DEPLOY.PARSEUPDATE #168

Open janwillemb opened 7 years ago

janwillemb commented 7 years ago

When checking for a new version, the deploy plugin never finds an update, but apparently gets an error while parsing the response. In the logcat, these are the only messages about the update:

IONIC.DEPLOY.CHECK: Checking for updates IONIC.DEPLOY.PARSEUPDATE: Unable to check for updates

My plugin versions are:

<plugin name="cordova-plugin-device" spec="~1.1.3" />
<plugin name="cordova-plugin-console" spec="~1.0.4" />
<plugin name="cordova-plugin-whitelist" spec="~1.3.0" />
<plugin name="cordova-plugin-statusbar" spec="~2.2.0" />
<plugin name="ionic-plugin-keyboard" spec="~2.2.1" />
<plugin name="cordova-plugin-network-information" spec="~1.3.1" />
<plugin name="cordova-plugin-app-version" spec="~0.1.9" />
<plugin name="cordova-plugin-splashscreen" spec="~4.0.1" />
<plugin name="ionic-plugin-deploy" spec="~0.6.5" />

relevant package.json snippet:

"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/compiler-cli": "2.2.1",
"@angular/core": "2.2.1",
"@angular/forms": "2.2.1",
"@angular/http": "2.2.1",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/platform-server": "2.2.1",
"@ionic/storage": "1.1.7",
"@ionic/cloud-angular": "0.11.0",
"ionic-angular": "2.0.1",
"ionic-native": "2.5.1",
"ionicons": "3.0.0",
"rxjs": "5.0.0-beta.12",
"zone.js": "0.6.26",
"sw-toolbox": "3.4.0",

app-id: 457662c0

Device manufacturer=LGE model=Nexus 5X platform=Android

I already tried uninstalling and reinstalling the plugins, uninstalling and reinstalling all node modules, removing android platform entirely, deleting the node_modules, platforms, plugins folder and reinstalling everything, to no avail.

Is there something I can do to do more logging about the request? Or can anyone check if I am doing something wrong?

janwillemb commented 7 years ago

Solved it. If you have a version in config.xml, it has to be a semantic-versioned string, or at least a string with max 3 elements. I had 2017.04.0.1, which is our internal versioning system. I changed it to 2017.04.01, and now it works. It would be nice if the plugin could warn about this and continues without using the version.

Change the method deconstructVersionLabel to:

private String deconstructVersionLabel(String label) {
  String result = label.split(":")[0];
  int partsCount = result.split("\\.").length;
  if (partsCount != 3) {
    result = "";
    logMessage("VERSIONLABEL", "Use binary/semantic versioning (major.minor.patch)");
  }
  return result;
}

And remove the [0] behind the two usages of this method.

This is actually an issue in ionic-plugin-deploy. Can this issue be moved?

And I think the server should do this check, not the client.

janpio commented 7 years ago

For context: The function currently lives at https://github.com/driftyco/ionic-plugin-deploy/blob/master/src/android/IonicDeploy.java#L157-L159 for Android and https://github.com/driftyco/ionic-plugin-deploy/blob/master/src/ios/IonicDeploy.m#L103-L105 for iOS.

@janwillemb I think the best way to get this fixed would be if you created a PR on ionic-plugin-deploy yourself.