[Olive Testing] Android plugin
Testings env
- Android emulator
- AVD Pixel_3a_API_33_arm64_v8a
- LMS: https://olive.demo.overhang.io
- Apk download URL: https://mobile.olive.demo.overhang.io/app.apk
Login
State: Failed STR:
- Click on login link
- Enter email and password
- Click login

Registration
State: Failed Note - user is actually created. Register the same user will give and Existent user error. STR:
- Click on register link
- Fill Full name, Public Name, Email, Password
- Select Agreement checkbox
- Submit
Register page
TOS link makrup is broken.

I can confirm that logging in is impossible. I'm getting the following logs from the server:
tutor_local-lms-1 | 2022-10-24 19:11:17,763 INFO 7 [tracking] [user None] [ip 78.196.96.100] logger.py:41 - {"name": "/oauth2/access_token/", "context": {"user_id": null, "path": "/oauth2/access_token/", "course_id": "", "org_id": "", "enterprise_uuid": ""}, "username": "", "session": "", "ip": "78.196.96.100", "agent": "Dalvik/2.1.0 (Linux; U; Android 12; LE2115 Build/RKQ1.211119.001) Open edx olive Demo/io.overhang.demo.olive/3.1.4", "host": "olive.demo.overhang.io", "referer": "", "accept_language": "", "event": "{\"GET\": {}, \"POST\": {\"grant_type\": [\"password\"], \"client_id\": [\"android\"], \"username\": [\"admin\"], \"password\": \"********\"}}", "time": "2022-10-24T19:11:17.762963+00:00", "event_type": "/oauth2/access_token/", "event_source": "server", "page": null}
tutor_local-caddy-1 | {"level":"error","ts":1666638677.780014,"logger":"http.log.access.log0","msg":"handled request","request":{"remote_addr":"78.196.96.100:39550","proto":"HTTP/2.0","method":"POST","host":"olive.demo.overhang.io","uri":"/oauth2/access_token/","tls":{"resumed":false,"version":772,"cipher_suite":4865,"proto":"h2","proto_mutual":true,"server_name":"olive.demo.overhang.io"}},"user_id":"","duration":0.033390752,"size":27,"status":401}
tutor_local-lms-1 | [pid: 7|app: 0|req: 1485/4373] 172.18.0.8 () {44 vars in 918 bytes} [Mon Oct 24 19:11:17 2022] POST /oauth2/access_token/ => generated 27 bytes in 33 msecs (HTTP/1.1 401) 9 headers in 588 bytes (1 switches on core 0)
LMS is replying to POST /oauth2/access_token/ with a 401 Unauthorized error. I have no idea why.
If someone with mobile dev skills reads this, I could use a hand...
@regisb Custom Android build using oauth client credentials from https://olive.demo.overhang.io/oauth2/access_token/ works fine (at least Login step). So I suspect incorrect oauth client_id/token being added during the apk build step. Need to review the build process.
Tested on the latest deploy/build.
Login works!

To be continue...
Additional testing for Android app
Profile editing
Steps:
- Set Age on the Account Web page
/account(13+ years) - On Mobile Open profile
- Click Edit
- Change Location
- Change Spoken Language
- Add About me
- Upload Icon image
- Check changes on Profile (https://apps.olive.demo.overhang.io/profile/u/
) and Account /accountpage
Status: PASS
Enrolled course on main screen
Steps:
- Enroll to a Course on the LMS Dashboard Web page
- Open Studio, login as a staff user
- Open the Course Advanced settings
- Set
Mobile course availableto true - Open Mobile app
- Login
- Check that Enrolled Course in available on the main screen
Status: PASS
Open enrolled course from the main screen
Steps:
- Enroll to a Course on the LMS Dashboard Web page
- Open Studio, login as a staff user
- Open the Course Advanced settings
- Set
Mobile course availableto true - Open Mobile app
- Login
- Check that Enrolled Course in available on the main screen
- Open Course by click on it
- Check the Course Home screen
Status: FAILED Details: Application crashed
@cmltaWt0 thanks for the detailed input!.. I was going over the logs of edx-app-android to see if there might be already a fix for the last failed test and I found this openedx/edx-app-android/pull/1694 which I think is realted to the last test, if yes then we should add it to #205
Awesome jobs! So @cmltaWt0 I presume we should add all these as new test cases. These will be the first new test cases added to the sheet since testing began. I endeavour to add them tomorrow.
Android app was upgraded to 3.2.2 on the Olive demo server. Can you please run the failed tests again?
@cmltaWt0, have you been able to re-run the tests?
@cmltaWt0, have you been able to re-run the tests?
Sure, will do today.
Tested the 3.2.2 version on emulator and on real device. It's crashed on login/register step. Crash report says the following:
java.lang.RuntimeException:
java.lang.InstantiationException: java.lang.Class<org.edx.mobile.util.Config$ApiUrlVersionConfig> has no zero argument constructor at
org.edx.mobile.util.Config.getObjectOrNewInstance(Config.java:783) at
...
...
@regisb could you check the configuration option for the build please?
If configuration looks good I can try to backport the My Courses screen detached fragment issue for ViewModel fix to olive.master and then we can rebuild from this branch but not from a release tag.
Thanks for testing @cmltaWt0. I have no idea what is going on. Configuration is supposed to be ok, as I didn't change it since the last release. I also observe that the app is crashing, though I don't know why. (I don't even know how to generate a crash report on my phone...) No logs are generated on the server.
You are talking about this PR, right? https://github.com/openedx/edx-app-android/pull/1694/ It should already be present in the app, as we are running 3.2.2 which was published in October: https://github.com/openedx/edx-app-android/releases/tag/release%2F3.2.2
Any other idea?
EDIT: I downgraded the generated app from 3.2.2 to 3.1.4. With 3.1.4 I am able to login... but then the app crashes on opening the demo course. I need to figure out what happened between those two versions that could cause the crash in v3.2.2.
EDIT: Version 11bb840580df92098717e875c7d68b6a994a9205 (latest commit from the master branch) is also broken. App also crashes after login.
EDIT: for the record, 3.0.2 was the last known version to work (in Nutmeg). I tried it with Olive and it works. So if we can't get 3.2.2 to work we'll have to keep 3.0.2.
Release janitor check: what are we doing here, if anything, for Olive.1? We only have a couple of hours.
I downgraded the android plugin to 3.0.2. We'll work later to upgrade to 3.2.2.
Following our today BTR call, there was a bug that I encournted in different context enrollment is not possible when using the APK.
It would return 400 code, the way to resolve for that was to disable the ProGuard featuer. By commenting the following lines:
https://github.com/openedx/edx-app-android/blob/11bb840580df92098717e875c7d68b6a994a9205/OpenEdXMobile/build.gradle#L501-L508
In particualr I think this commit https://github.com/openedx/edx-app-android/commit/70909441aa085c332b08dabb29b193100ad69fb8 is probably the reason for bug.
I'm a terrible mobile developer and I need help with this issue, so I'll unassign myself. As an acceptance criteria, I'd like someone to open a PR on the tutor-android plugin repo to upgrade the app from 3.0.2 to 3.2.2 (or later). Users should be able to login, register and enroll in courses from the app.
@cmltaWt0, are you currently working on this? otherwise, let's mark this issue as unassigned to let people know this issue is requiring someone to work on it.
@jalondonot actually I don't. Was just a reported and tried to help to diagnose the issue. Let me un-assign myself for now 👍 Maybe later I can pick this up and try it again.
@regisb @cmltaWt0: do you folks know if this issue was resolved? If not, do you know someone we could contact to help us with this issue? I don't know anyone who is familiar with the Android app.
I mean, the android app is really supposed to be working in Quince, so my guess is that yes, this issue is now resolved.