e-mission / e-mission-docs

Repository for docs and issues. If you need help, please file an issue here. Public conversations are better for open source projects than private email.
https://e-mission.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
15 stars 34 forks source link

Trying to run the DFKI UI #492

Open shankari opened 4 years ago

shankari commented 4 years ago

I am trying to pull and run the DFKI UI from branch 'dfki' of https://github.com/mcq-dev/e-mission-phone with the devapp, but I can't get it to work correctly. Here's what I find from the testing.

Running on API 24 (Android 7.0), I get a WSOD with the following errors generated

services.js:387 Uncaught SyntaxError: Unexpected token function
current.js:233 Uncaught SyntaxError: Unexpected token function
heatmap.js:38 Uncaught SyntaxError: Unexpected token function
metrics.js:553 Uncaught SyntaxError: Unexpected token function
goals.js:269 Uncaught SyntaxError: missing ) after argument list

Looking through these files, all of them seem to deal with the async keyword before function - e.g.

  var getServerIncidents = async function() {

which seem to have been added in the new branch

Running on API 28 (Android 9.0), I get a real screen, but the formatting is all messed up

shankari commented 4 years ago

From https://github.com/mcq-dev/e-mission-phone/tree/dfki/www/css it looks like they moved the css files to scss, and added README instructions to compile https://github.com/mcq-dev/e-mission-phone/commit/b02ccf967b2c9feb240d36e1bce3912125850a83

Let's see if that fixes it at least on 9.0

shankari commented 4 years ago

ok with the new step

$ npm run sass-build

I do get the UI to show up in 9.0. But not in 7.0

shankari commented 4 years ago

I can confirm that if I run the pre-built apk for MECO2_V0.1.apk in an android emulator with version 7.0, I get the same WSOD.

shankari commented 4 years ago

I suspect this is due to the version of the webview in the emulator. Since Lollipop, the system webview is a separate app that is updated through the regular update process. But since there is no update process in the emulator, the webview is not updated.

On the 7.0 emulator, the version is 51.0.2704.90. Current version in the play store is 79.0.3945.116. On the 9.0 emulator, the version is 69.0.3497.100

On my personal android device, which is on android 6.0, the chrome (webview) version is 79.0.... So this should probably work on an actual 6.0/7.0 device as well.

shankari commented 4 years ago

@lefterav I would suggest trying the apk on an real android 7.0 device to ensure that it works. Then, if you are interested, you can submit a PR to pull the changes to the https://github.com/e-mission/e-mission-phone/tree/dfki branch and I will publish it to a channel that you can use with the emTripLog base app for testing, specially on iOS

lefterav commented 4 years ago

So we have been informed that the final branch, where the latest additions took place is this one: https://github.com/mcq-dev/e-mission-phone/tree/deploy

I will try to reproduce this build soon.

shankari commented 4 years ago

@lefterav sounds good. If you have any issues using the devapp, please file an issue.

shankari commented 4 years ago

@lefterav have you had a chance to try this out? Are you going to submit a PR to the https://github.com/e-mission/e-mission-phone/tree/dfki branch?

lefterav commented 4 years ago

Unfortunately due to family issues I coudn't go further with it. It is still on my todo list.

shankari commented 4 years ago

@lefterav any updates on this?

shankari commented 4 years ago

@sosias I was the person who tried to build this - see the original author. I am not sure what you meant by "it isn't merged in".

I already proactively pulled code from your branch https://github.com/mcq-dev/e-mission-phone. The issue was with the rewrite of the code to use async function - e.g.

var getServerIncidents = async function() {

which is only supported in chromium 55+ and iOS safari 10.3+ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function

the default chromium in android 7.0 is 51.0.2704.90, but of course, the webview is automatically updated now. I am waiting for confirmation that this does indeed work on a few different versions of android and iOS.

Also, I am not sure I pulled from the correct branch.

lefterav commented 4 years ago

Hi shankari. The unsucessful build occurred in the branch mcq-dev/e-mission-phone/tree/dfki . The deployed version is on the branch mcq-dev/e-mission-phone/tree/deploy . I don't think I will have the time to test the build myself, very soon.

I don't know if things should happen here, or at the fork of DFKI, but I guess the next step would be to merge the 'deploy' branch into the 'dfki' branch and the submit a PR to you.

sosias commented 4 years ago

Sounds good, so is easier for all to find the right branches :) I did as leftrav said. I merged the mcqdev/deploy branch into the mcqdev/dfki branch, then I send a PR to the e-mission repo (this)

shankari commented 4 years ago

@lefterav

I don't know if things should happen here, or at the fork of DFKI, but I guess the next step would be to merge the 'deploy' branch into the 'dfki' branch and the submit a PR to you.

They should happen in the fork of DFKI if you want to maintain an independent version of the UI that you are making ongoing changes to. It should happen in a branch of e-mission-phone if you don't want to commit to that and are giving the UI back to the community.

@sosias Great! Looking forward to the PR!

lefterav commented 4 years ago

@shankari, I think we should do both. We need to present a separate DFKI fork/repository as result of our project, but the results should be definitely pushed back to the community.

shankari commented 4 years ago

@lefterav I see that @sosias has sent out a PR https://github.com/e-mission/e-mission-phone/pull/634

Would you like me to deploy that as a channel for you to test on both android and iOS?

lefterav commented 4 years ago

Yes, deploying on a channel would be great. I am trying to build also on my side. The android version did not raise an error. The iOS version gave me the following:

cordoba prepare

(node:26286) UnhandledPromiseRejectionWarning: Error: Source path does not exist: google-services.json
    at updatePathInternal (/home/elav01/workspace/e-mission-phone/platforms/android/cordova/node_modules/cordova-common/src/FileUpdater.js:145:19)
    at /home/elav01/workspace/e-mission-phone/platforms/android/cordova/node_modules/cordova-common/src/FileUpdater.js:223:19
    at Array.forEach (<anonymous>)
    at Object.updatePaths (/home/elav01/workspace/e-mission-phone/platforms/android/cordova/node_modules/cordova-common/src/FileUpdater.js:221:33)
    at updateFileResources (/home/elav01/workspace/e-mission-phone/platforms/android/cordova/lib/prepare.js:431:17)
    at /home/elav01/workspace/e-mission-phone/platforms/android/cordova/lib/prepare.js:51:9
    at _fulfilled (/home/elav01/workspace/e-mission-phone/platforms/android/cordova/node_modules/q/q.js:854:54)
    at /home/elav01/workspace/e-mission-phone/platforms/android/cordova/node_modules/q/q.js:883:30
    at Promise.promise.promiseDispatch (/home/elav01/workspace/e-mission-phone/platforms/android/cordova/node_modules/q/q.js:816:13)
    at /home/elav01/workspace/e-mission-phone/platforms/android/cordova/node_modules/q/q.js:624:44
(node:26286) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
shankari commented 4 years ago

@lefterav you need to generate a google-services.json for the push notifications. Dup of https://github.com/e-mission/e-mission-docs/issues/361

shankari commented 4 years ago

if you feel like this is an FAQ, add it to the README :)