SapuSeven / BetterUntis

An alternative mobile client for the Untis timetable system.
GNU General Public License v3.0
240 stars 34 forks source link

[Crash Report] App crashes on startup #201

Closed konstantinhirschfeld closed 2 years ago

konstantinhirschfeld commented 2 years ago

APP crashes immediately after beging opened, shows this error message:

Logs ``` l.b.e: Field 'message' is required, but it was missing at com.sapuseven.untis.models.untis.UntisError.(Unknown Source:30) at com.sapuseven.untis.models.untis.UntisError$$serializer.deserialize(Unknown Source:126) at com.sapuseven.untis.models.untis.UntisError$$serializer.deserialize(Unknown Source:0) at i.a.a.a.u0.m.l1.a.C(:12) at l.b.x.u.j.s(Unknown Source:5) at i.a.a.a.u0.m.l1.a.B(Unknown Source:11) at l.b.x.u.j.x(:1) at l.b.u.a.g(Unknown Source:10) at com.sapuseven.untis.models.untis.response.MessageResponse$$serializer.deserialize(Unknown Source:147) at com.sapuseven.untis.models.untis.response.MessageResponse$$serializer.deserialize(Unknown Source:0) at i.a.a.a.u0.m.l1.a.C(:12) at l.b.x.u.j.s(Unknown Source:5) at l.b.x.a.a(:1) at com.sapuseven.untis.activities.MainActivity.W(:15) at com.sapuseven.untis.activities.MainActivity$e.d(Unknown Source:12) at i.w.k.a.a.j(:2) at l.a.i0.run(:2) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7664) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) ```

Additional information

SapuSeven commented 2 years ago

Due to the high number of crashes lately (about 50 reports in the last hour), I assume this is caused by Untis changing their API again.

konstantinhirschfeld commented 2 years ago

Ah, that makes sence.

SapuSeven commented 2 years ago

I'll keep this issue open to keep track of progress because resolving this needs an app update.

DreamyLynn commented 2 years ago

This will require a big rework. They changed the authentication system ground-up.

SapuSeven commented 2 years ago

Please take a look at build#737. I updated the login process and successfully tested anonymous login. Clean all app data if necessary and log in as usual. Please report back if you can login and access the timetable screen without crashing. (There may be an error regarding invalid JSON when trying to view the timetable, this will be fixed later.)

lm41 commented 2 years ago

Yes, the login works. The timetable doesnt load. And it gets an error.

eliasbnr commented 2 years ago

I don't really know if this is only for debug build but I'm getting this error after logging in using Android 12:

Logs ``` java.lang.RuntimeException: Unable to start receiver com.sapuseven.untis.receivers.StartupReceiver: java.lang.IllegalArgumentException: com.sapuseven.untis.debug: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. at android.app.ActivityThread.handleReceiver(ActivityThread.java:4317) at android.app.ActivityThread.access$1600(ActivityThread.java:247) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2064) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7839) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) Caused by: java.lang.IllegalArgumentException: com.sapuseven.untis.debug: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles. at android.app.PendingIntent.checkFlags(PendingIntent.java:375) at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645) at android.app.PendingIntent.getBroadcast(PendingIntent.java:632) at com.sapuseven.untis.receivers.StartupReceiver.onReceive(StartupReceiver.kt:36) at android.app.ActivityThread.handleReceiver(ActivityThread.java:4308) ... 9 more ```

Additional information

KaratekHD commented 2 years ago

In this build, logging in with a QR code does not work, as seen in the screenshot. It does work however if I replace the school name with the ID.

Screenshot_20211207-075105_BetaUntis__01.png

I'm not sure if this is a general problem or something with the debug build.

bennetrr commented 2 years ago

I get the same error as @KaratekHD

SapuSeven commented 2 years ago

Thanks for the feedback, I'll have another build ready later today that addresses the new issues.

SapuSeven commented 2 years ago

Alright, I just pushed some fixes. Please test build#747, if everything works I'll publish a Google Play Release.

eliasbnr commented 2 years ago

Alright, I just pushed some fixes. Please test build#747, if everything works I'll publish a Google Play Release.

It's working fine for me.

konstantinhirschfeld commented 2 years ago

Alright, I just pushed some fixes. Please test build#747, if everything works I'll publish a Google Play Release.

Are you going to update the fdroid Version as well?

bennetrr commented 2 years ago

It works for me when I enter the School Number, but entering the School Name (which is given by the QR-Code in my case) just gives me an error: "Ungültige Schul-ID!"

Luis-L-B commented 2 years ago

Alright, I just pushed some fixes. Please test build#747, if everything works I'll publish a Google Play Release.

Its mostly working. Login and showing lessons works, however certain objects like "exam" are not processed. (Unknown JSON object "exam" encountered, value: {"id":0000,"examtype":"Type of exam","name": "custom name", "Custom Text"} There are also other Objects like StaffAttachments or staffInfo, but we dont use those

SapuSeven commented 2 years ago

@nonamewastaken:

Are you going to update the fdroid Version as well?

Yes, FDroid and Play Store updates are linked and will update simultaneously.

@bennetrr:

It works for me when I enter the School Number, but entering the School Name (which is given by the QR-Code in my case) just gives me an error: "Ungültige Schul-ID!"

Could you provide me with the exact values for the school name and the school number to check this out? You can email me directly.

@Luis-L-B:

Its mostly working. Login and showing lessons works, however certain objects like "exam" are not processed. (Unknown JSON object "exam" encountered, value: {"id":0000,"examtype":"_Type of exam_","name": "_custom name_", "_Custom Text_"} There are also other Objects like StaffAttachments or staffInfo, but we dont use those

These objects are not used by BetterUntis (yet), so you can ignore these errors.

lm41 commented 2 years ago

It works well.

KaratekHD commented 2 years ago

Alright, I just pushed some fixes. Please test build#747, if everything works I'll publish a Google Play Release.

Worked just fine for me, I had to clear app data for it to work though.

SapuSeven commented 2 years ago

The update has just been released 🎉 It will be available to Google Play Beta and FDroid users soon.

konstantinhirschfeld commented 2 years ago

Awesome, tysm

nautilusx commented 2 years ago

3.47 works fine! @SapuSeven THANK YOU!