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: Cannot check for updates #57

Open mjaworski-eab opened 8 years ago

mjaworski-eab commented 8 years ago

We had our application working for Ionic Cloud Beta. When we updated to Stable and updated the libraries we always get false from $ionicDeploy.check().

We reviewed these things:

Our actual call to check looks like:

.controller('updateIonicController', function ($ionicDeploy) {
 $ionicDeploy.check()
  .then((hasUpdates) => {
    // ISSUE; hasUpdates is always false     
  });
});

Cloud Setup

.io-config.json

{"app_id":"...","api_key":"..."}

ionic.config.json

{
  "name": "...",
  "v2": false,
  "typescript": false,
  "app_id": "..."
}

In our source code:

$ionicCloudProvider.init({
  core: {
    app_id: // we verified that this id exists and has a newer version uploaded to the correct channel
  }
});

Package JSON

"cordovaPlugins": [
    "cordova-plugin-wkwebview-engine@1.0.3",
    "cordova-plugin-crosswalk-webview@1.4.0",
    "cordova-plugin-device@1.1.2",
    "cordova-plugin-console@1.0.3",
    "cordova-plugin-whitelist@1.2.2",
    "cordova-plugin-splashscreen@3.2.2",
    "cordova-plugin-statusbar@2.1.3",
    "cordova-plugin-inappbrowser",
    "ionic-plugin-keyboard@2.2.1",
    "cordova-plugin-network-information@1.2.1",
    },
    "ionic-plugin-deploy@0.6.4"
  ],
  "cordovaPlatforms": [
    "android",
    "ios"
  ],
  "dependencies": {
    "@ionic/cloud": "0.9.0"
  }

Ionic Info

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.8.6 
ios-sim version: 5.0.8 
OS: Mac OS X El Capitan
Node Version: v6.5.0
Xcode version: Xcode 8.0 Build version 8A218a 

Error Log

This is copied from adb logcat. The error is below with IONIC.DEPLOY.PARSEUPDATE. I looked into IonicDeploy.java and it seems the issue is below. The if statement (response.json != null) discovers that response.json is null. I could not discover any other info.

private void parseUpdate(CallbackContext callbackContext, JsonHttpResponse response) {

    this.last_update = null;
    String ignore_version = this.prefs.getString("ionicdeploy_version_ignore", "");
    String loaded_version = this.prefs.getString("loaded_uuid", "");

    try {     
      if (response.json != null) {
        // ...
      }
      else {
        logMessage("PARSEUPDATE", "Unable to check for updates.");
        callbackContext.success("false");
      }
}
IONIC.DEPLOY.CHECK: Checking for updates
09-28 11:12:27.685 18374 19278 I System.out: (HTTPLog)-Static: isSBSettingEnabled false
09-28 11:12:27.685 18374 19278 I System.out: (HTTPLog)-Static: isSBSettingEnabled false
09-28 11:12:27.685   411  1992 D EnterpriseController: netId is 0
09-28 11:12:27.685   411  1992 D Netd    : getNetworkForDns: using netid 510 for uid 10202
09-28 11:12:27.755 18374 18374 W BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 18374

## Error is expressed here
09-28 11:12:28.035 18374 19278 I IONIC.DEPLOY.PARSEUPDATE: Unable to check for updates.

09-28 11:12:28.045 18374 18374 I chromium: [INFO:CONSOLE(1841)] "Ionic Deploy: no updates available", source: file:///android_asset/www/lib/ionic/ionic.cloud.js (1841)
09-28 11:12:28.335  2407  2782 D 

Additional Hint

When our application starts we get this message in chrome://inspect.

Failed to load resource: the server responded with a status of 422 (UNPROCESSABLE ENTITY)
logger.js:66 Ionic Insights: Could not send insights. Error: UNPROCESSABLE ENTITY
    at Request.<anonymous> (file:///android_asset/www/lib/ionic/ionic.cloud.js:3412:19)
    at Request.Emitter.emit (file:///android_asset/www/lib/ionic/ionic.cloud.js:2834:20)
    at XMLHttpRequest.xhr.onreadystatechange (file:///android_asset/www/lib/ionic/ionic.cloud.js:3776:10)Logger.error @ logger.js:66
ericb commented 8 years ago

@jaworskm What is the app id?

@Fuiste Let's add an update to the plugin that will dump more information about the request / response when checking for an update.

mjaworski-eab commented 8 years ago

app_id: b679588e

Thanks!

mjaworski-eab commented 8 years ago

Is there a resolution? How should we move forwards?

Fuiste commented 7 years ago

@jaworskm which version of ionic-plugin-deploy are you using? I ask because I can't reproduce this issue with 0.11.0 of the cloud client and 0.6.5 of the deploy plugin.

mjaworski-eab commented 7 years ago

Ok, that could work. We were on:

I'll update and try. Thanks!

"cordovaPlugins": [
    "cordova-plugin-wkwebview-engine@1.0.3",
    "cordova-plugin-crosswalk-webview@1.4.0",
    "cordova-plugin-device@1.1.2",
    "cordova-plugin-console@1.0.3",
    "cordova-plugin-whitelist@1.2.2",
    "cordova-plugin-splashscreen@3.2.2",
    "cordova-plugin-statusbar@2.1.3",
    "cordova-plugin-inappbrowser",
    "ionic-plugin-keyboard@2.2.1",
    "cordova-plugin-network-information@1.2.1",
    },
    "ionic-plugin-deploy@0.6.4"
  ],
  "cordovaPlatforms": [
    "android",
    "ios"
  ],
  "dependencies": {
    "@ionic/cloud": "0.9.0"
  }
Henryisthebest commented 7 years ago

any news on this? i'm getting the same error.

Henryisthebest commented 7 years ago

also where did you get your list of corodvaPlugins, cordovaPlatforms, dependencies from?