microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.2k stars 1.69k forks source link

[de.mvg.more] Crashes when typing on a icon on the map #1937

Closed MhhhxX closed 1 year ago

MhhhxX commented 1 year ago

Affected app Name: MVG More Package id: de.mvg.more

Describe the bug The app works well. I can open the app and register a new account. But when typing on a icon on the map the app crashes.

To Reproduce Steps to reproduce the behavior:

  1. Open the app
  2. register a new acount
  3. go to the map
  4. type on any icon on the map (e.g. bike, car, scooter, etc.)
  5. app crashes

Expected behavior A new view should open

Screenshots

System Android Version: 13 Custom ROM: LineageOS 20.0

microG microG Core version: 0.2.27.223616 microG Self-Check results: All ticked

Additional context LogCat shows:

FATAL EXCEPTION: main
Process: de.mvg.more, PID: 32159
java.lang.NullPointerException: Attempt to invoke virtual method 'float java.lang.Float.floatValue()' on a null object reference
    at com.google.android.gms.maps.model.PatternItem.<init>(PatternItem.java:32)
    at com.google.android.gms.maps.model.Dot.<init>(Dot.java:24)
    at com.google.android.gms.maps.model.PatternItem$1.createFromParcel(PatternItem.java:48)
    at com.google.android.gms.maps.model.PatternItem$1.createFromParcel(PatternItem.java:40)
    at android.os.Parcel.readTypedObject(Parcel.java:3982)
    at android.os.Parcel.createTypedArrayList(Parcel.java:3625)
    at com.google.android.gms.maps.model.internal.IPolylineDelegate$Stub.onTransact(IPolylineDelegate.java:299)
    at org.microg.gms.maps.mapbox.model.PolylineImpl.onTransact(Polyline.kt:153)
    at android.os.Binder.transact(Binder.java:1164)
    at b8.a.zzc(Unknown Source:7)
    at b8.f.S0(Unknown Source:9)
    at com.google.android.gms.maps.model.Polyline.setPattern(Unknown Source:2)
    at dc.k1$n.invoke(Unknown Source:11)
    at x0.j$c.invoke(Unknown Source:29)
    at x0.y.invoke(Unknown Source:39)
    at x0.e0.v(Unknown Source:59)
    at x0.e0.l(Unknown Source:5)
    at x0.f2$a.invoke(Unknown Source:196)
    at androidx.compose.ui.platform.k0.doFrame(Unknown Source:6)
    at androidx.compose.ui.platform.h0$c.doFrame(Unknown Source:47)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1229)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
    at android.view.Choreographer.doCallbacks(Choreographer.java:899)
    at android.view.Choreographer.doFrame(Choreographer.java:827)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7884)
    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:936)
    Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [x0.p1@8f971d9, androidx.compose.ui.platform.q1@9bbc79e, StandaloneCoroutine{Cancelling}@dfa527f, h0@5f2024c]
ocroquette commented 1 year ago

I have the same issue. The MVGO app version 6.16.0.44 worked fine (confirmed by downgrading), but 6.20.1.55 crashes as described by MhhhxX. I used to downgrade the app to continue using it, but unfortunately now the server refuses to talk to 6.16.0.44 and requests an update.

I looked at the history of "PatternItem":

git log -p ./play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java

commit 16af655dde6af348a192975d1b03bed5af1c5684
Author: Fynn Godau <fynngodau@mailbox.org>
Date:   Tue Mar 14 13:35:26 2023 +0000

    Merge branch 'epic67-maps-merge' into 'master'

    Merge epic

    See merge request e/os/GmsCore!67

diff --git a/play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java b/play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java
index 6f8e3f7a..1278df94 100644
--- a/play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java
+++ b/play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java
@@ -21,7 +21,7 @@ public class PatternItem extends AutoSafeParcelable {
     @Field(2)
     private int type;
     @Field(3)
-    private float length;
+    private Float length;

     private PatternItem() {
     }

commit 24b0bfa998a23ace0851e5181cf5f3c13db28b5c
Author: Marvin W <git@larma.de>
Date:   Sat Dec 24 21:02:19 2022 +0100

    Maps: Add a few missing parts

diff --git a/play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java b/play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java
index c964cb86..6f8e3f7a 100644
--- a/play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java
+++ b/play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java

@@ -19,7 +21,10 @@ public class PatternItem extends AutoSafeParcelable {
-    private Float length;
+    private float length;

commit 18c3a6154dc41cebe1d4aeda5592b8f23928356f
Author: Marvin W <git@larma.de>
Date:   Sun Oct 30 18:28:54 2022 -0600

    Merge/rename/restructure modules.

diff --git a/play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java b/play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java
new file mode 100644
index 00000000..c964cb86
--- /dev/null
+++ b/play-services-maps/src/main/java/com/google/android/gms/maps/model/PatternItem.java
@@ -0,0 +1,36 @@
+    private Float length;

As you can see, the type of the field length was changed back and forth between Float (a class) and float (a numeric type). Looking at the exception Attempt to invoke virtual method 'float java.lang.Float.floatValue()' on a null object reference, I cannot help to wonder if there is a connection.

The version installed is 0.2.27.223616-39 (9803dc4) The latest released version is 0.2.28.231657 according to the Git tags. It contains the latest change (16af655dde6a).

So maybe updating to 0.2.28 will help, but I am not sure how to update safely the microG services in CalyxOS.

ale5000-git commented 1 year ago

It is explained here as to update safely: https://github.com/micro5k/gmscore-info

MhhhxX commented 1 year ago

I think you were on the right track @ocroquette. The work of @fynngodau seems to fix the crash - I updated GmsCore and the app works perfectly fine now. Big thanks!

ocroquette commented 11 months ago

For the record, the current version of CalyxOS (4.13.2) comes with microG 0.2.28.233013-125 (877b8d1), which does not have this problem anymore.