Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Installation procedure Android OKKish and iOS Fails + WKWebview crashes #146

Closed
barocsi opened this issue May 2, 2016 · 14 comments
Closed

Comments

@barocsi
Copy link

barocsi commented May 2, 2016

Android:

I have the following order of events when I update something on Android,
on first run it says installation is ready to be updated
then nothing happens
I dont quit the app, just deactivate
I deactivate the app, then it navigates to the stored old version
I get an event that chcp_updateInstalled
and it works...is this the intended behavior?

iOS, WKWebview:

I simply get an error, for the same manifest that wors for Android:
++++++++++++++++++ to chcp_updateLoadFailed – CustomEvent {detail: {error: {code: -4, description: "Hash c22cc828ab432172b069b4cddb4b435c of the file …tch the checksum 10f6bae1011fe6816fbd7affa1915cfe"}}, clipboardData: undefined, initCustomEvent: function, …}

UPDATE

after a successful installation of update, download and reload of page in cordova debugger I can see
2016-05-02 16:23:16.720 App[778:963626] WkWebView crash detected, recovering...

@barocsi
Copy link
Author

barocsi commented May 2, 2016

Ok this is another good experience for the others, it seems my server is caching certain files, so the hashes will eventually fail.

@barocsi barocsi closed this as completed May 2, 2016
@nikDemyankov
Copy link
Member

I dont quit the app, just deactivate

What do you mean by deactivate?

I deactivate the app, then it navigates to the stored old version
I get an event that chcp_updateInstalled
and it works...is this the intended behavior

Depends on the preferences in chcp.json file. There's a preference, called update. By default it is set to start, which means that update will be installed when application is launched. If you want the app to update immediately - set it to now, or start installation process manually from JS side.

Ok this is another good experience for the others, it seems my server is caching certain files, so the hashes will eventually fail.

Good catch 👍

@barocsi
Copy link
Author

barocsi commented May 2, 2016

deactivate means minimizing it.
Another issue arisen after a successful update for ios wkwebview I receive an app.html not found. It happens not all the time. I continue to inspect this issue.
This build is using https://github.com/Telerik-Verified-Plugins/WKWebView

@barocsi barocsi reopened this May 2, 2016
@barocsi
Copy link
Author

barocsi commented May 2, 2016

I have added "update":"now" to chcpbuild.options, but it not gets copied into chcp.json.

@nikDemyankov
Copy link
Member

nikDemyankov commented May 2, 2016

chcpbuild.options is used only to set preferences in platform-specific config.xml file. More details can be found here.

update preference should go to chcp.json file, that is placed on the server, because it defines the behaviour of the plugin with this particular release.

If you have created cordova-hcp.json file - then put it in there. For example:

{
  "content_url": "https://myserver.com/www/",
  "release": "2015.09.05-12.20.15",
  "update": "now"
}

UPDATE:

In that case - when you will execute cordova-hcp build - it will be placed automatically into chcp.json.

@barocsi
Copy link
Author

barocsi commented May 2, 2016

That was really my fault, i have misconfigured it in the options file.
I will give feedback on the WKWebview issue asap.

@barocsi
Copy link
Author

barocsi commented May 2, 2016

According to the previous hash problem. You need to pay attention to this
http://superuser.com/questions/377743/same-file-different-file-size
it might generate different hash sizes. I mean, you generate the hashes on WIN copy in text transfer to a NIX and the resulting file size will be different ergo malformed checksum will be the result.

@barocsi barocsi changed the title Installation procedure Android OKKish and iOS Fails Installation procedure Android OKKish and iOS Fails + WKWebview crashes May 2, 2016
@barocsi
Copy link
Author

barocsi commented May 2, 2016

after a successful installation of update, download and reload of page in cordova debugger I can see
2016-05-02 16:23:16.720 App[778:963626] WkWebView crash detected, recovering...
Is auto-install crash related to #140 ?

@nikDemyankov
Copy link
Member

As you already found out - currently plugin supports on iOS only cordova-plugin-wkwebview-engine, not teleriks version. Issue for telerik support is already added: #98

@barocsi
Copy link
Author

barocsi commented May 2, 2016

Thanks. In other thread I was wondering meanwhike can I use v1.1.2 for iOS.

@nikDemyankov
Copy link
Member

Answered in there :) Check the links I provided there and decide. But in my opinion - changes are quite big since v1.1.2. I will try to make a quick fix tomorrow, might work.

@barocsi
Copy link
Author

barocsi commented May 2, 2016

That would be awesome. You are great!

@nikDemyankov
Copy link
Member

I've created a branch with possible fix for telerik plugin. But it will work only if your index page doesn't have # in the url. But I suspect that's should be fine in your case.

To install the plugin use the following command:

cordova plugin add https://github.com/nordnet/cordova-hot-code-push.git#telerik-wkwebview-fix

@barocsi
Copy link
Author

barocsi commented May 3, 2016

@nikDemyankov thanks a lot, saves the day!

@barocsi barocsi closed this as completed May 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants