Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to run the DFKI UI #492

Open
shankari opened this issue Jan 19, 2020 · 19 comments
Open

Trying to run the DFKI UI #492

shankari opened this issue Jan 19, 2020 · 19 comments

Comments

@shankari
Copy link
Contributor

shankari commented Jan 19, 2020

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
Copy link
Contributor Author

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
mcq-dev/e-mission-phone@b02ccf9

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

@shankari
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

shankari commented Jan 19, 2020

@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
Copy link

lefterav commented Jan 22, 2020 via email

@shankari
Copy link
Contributor Author

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

@shankari
Copy link
Contributor Author

@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
Copy link

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

@shankari
Copy link
Contributor Author

@lefterav any updates on this?

@shankari
Copy link
Contributor Author

@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
Copy link

lefterav commented Mar 17, 2020

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
Copy link
Contributor

sosias commented Mar 17, 2020

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
Copy link
Contributor Author

@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
Copy link

@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
Copy link
Contributor Author

shankari commented Mar 17, 2020

@lefterav I see that @sosias has sent out a PR
e-mission/e-mission-phone#634

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

@lefterav
Copy link

lefterav commented Mar 31, 2020

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
Copy link
Contributor Author

@lefterav
you need to generate a google-services.json for the push notifications.
Dup of #361

@shankari
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants