-
Notifications
You must be signed in to change notification settings - Fork 338
[Android] Stuck on CHECKING_FOR_UPDATE #86
Comments
@dylanvdmerwe Thanks for reporting! To help us diagnose this issue, do you see any error being printed out in the console logs after the update is instaled? e.g. https://github.com/Microsoft/cordova-plugin-code-push/blob/master/www/codePush.ts#L286 |
Everything seemed to run perfectly. Even when the app is restarted, the new version runs as intended but nothing happens when the sync method tries to check for an update.
|
@dylanvdmerwe The logs you just pasted was before the update was installed right? Do you see any logs after the update is installed and the app is restarted? |
Near the bottom of the logs it states that it is installing the update and the install succeeded? Nothing else is shown from the logs. |
@dylanvdmerwe So I assume after all this is printed, the app then restarts by itself (since you are using InstallMode.IMMEDIATE), perfect, right? From what I understand from your problem description, you are seeing the sync process get stuck after the app restarts. Do you see anything in the logs after the app restarts? |
Or rather, how did you know/diagnose that it got stuck? |
After the restart:
The syncStatusCallback method fires once for CHECKING_FOR_UPDATE and then never fires again. There are no network requests being made either. |
@dylanvdmerwe how did you release updates to CodePush? Did u use |
and
Both give me the same thing. |
Its weird that you are not seeing any network request being fired, and there's nothing in the console notifying you that the request was somehow blocked or something. I did a test and I am definitely seeing it working with a blank app, I can release multiple updates and the app always successfully update from one version to another. The only thing I can think of is some conflict with another of your installed plugins? I will try to investigate further tomorrow. Sorry that you are hitting this issue! |
@dylanvdmerwe Are you testing on an emulator or a device? And how are you deploying the app? I noticed you're using Ionic. Are you just running "ionic run android"? Are you using live reload? It would be helpful to repro this to know you're exact setup. |
It's on a device. Deploying the app using I'm going to try grab one of their more 'complicated' sample projects and see if I can reproduce the issue. |
What version of Android is your device? |
Nexus 5 running Android 6.0.1 targeting API 22 |
Note, the same code works on iOS. |
Some more information from logs...
|
Thanks for the info @dylanvdmerwe. The URL is definitely correct, the metadata file currentpackage.json contains information about where the current update is stored on disk, and seeing that it has a size of 390 it definitely exists and is not empty. It's really bizarre that both Just a random stab, could u try modifying the code and change // fileReader.onloadend = function (ev) {
fileReader.onload = function (ev) {
callback(null, ev.target.result);
}; |
|
I was unable to reproduce this error with a Nexus 5, android 6 emulator though. Do you ever get this same problem in a different device? |
I don't have any other Android devices with me at this point in time. Going to set some emulators up to test shortly. |
What could be causing this though? How can we further debug this? Is there not a problem with the installation? I have just tried the app on Samsung S6 5.1.0 (w Crosswalk) emulator and Samsung S3 4.2.2 (w Crosswalk) emulator and after the update is installed the app hangs again. I also tried multiple versions of Crosswalk which didn't change anything. |
Digging into the FileReader.
The line that does not execute is:
|
Thats weird.. I wonder how Also, I wonder if your other issue #92 is related to your problem. The fact that the Finally, are you ever seeing this problem with a blank Cordova app with CodePush added to it? I want to rule out the possibility of a conflicting plugin. |
@dylanvdmerwe I think I may have found the problem. It appears to be an Angular2/zone.js bug: look at angular/angular#2533 and angular/zone.js#137 I think the angular version shipped with ionic 2.0 does not include the fix. To verify that this is indeed the cause of the issue, could you try changing our plugin code: /* old code
fileReader.onloadend = function (ev) {
callback(null, ev.target.result);
};
fileReader.onerror = function (ev) {
callback(new Error("Could not get file. Error: " + ev.error), null);
};
*/
// new code
fileReader.addEventListener('loadend', function(ev) {
callback(null, ev.target.result);
});
fileReader.addEventListener('error', function(ev) {
callback(new Error("Could not get file. Error: " + ev.error), null);
}); If this fix works, I will send out a PR including this fix. Also, could you let me know the version of angular2 and zone.js in your package.json? "dependencies": {
"angular2": "2.0.0-beta.6",
"zone.js": "0.5.14"
}, |
I had a feeling that would work, however I get the following error:
|
@dylanvdmerwe FYI, I still can't repro this error with a newly created a new ionic v2 project. Could you give it a try? I don't know if your project was created under an older ionic version. Perhaps simply recreating the project and moving all your code there will solve the problem. |
@geof90 that was a good suggestion. I created a new blank ionic 2 project and copied everything across. Works like a charm on the device now. Weird. |
@dylanvdmerwe I'm really glad that worked! We will be doing more validation of our plugin with Ionic 2 moving forward. |
Once an update has been installed, the next time the app runs and tries to check for an update, it gets stuck on the CHECKING_FOR_UPDATE status and does not move.
It seems as though the checkForUpdate callback does not fire once an update has been installed?
I'm working on Android. I've tried with and without Crosswalk.
The text was updated successfully, but these errors were encountered: