CrossGeeks / GeofencePlugin

Geofence Plugin for Xamarin iOS and Android
MIT License
48 stars 22 forks source link

Crash on Release Build with r8 code shrinker #36

Open sanjaychans opened 3 years ago

sanjaychans commented 3 years ago

Application crashes on release build with the following stack trace. This is a Xamarin Forms application. Any help is appreciated.

GeofenceImplementation.IsLocationEnabled (System.Action`1[T] returnAction) Java.Lang.IncompatibleClassChangeError: no "Lcom/google/android/gms/location/SettingsApi;" field "SettingsApi" in class "Lcom/google/android/gms/location/LocationServices;" or its superclasses

Stack traces Java.Interop JniEnvironment+StaticFields.GetStaticFieldID (Java.Interop.JniObjectReference type, System.String name, System.String signature) Java.Interop JniType.GetStaticField (System.String name, System.String signature) Java.Interop JniPeerMembers+JniStaticFields.GetFieldInfo (System.String encodedMember) Java.Interop JniPeerMembers+JniStaticFields.GetObjectValue (System.String encodedMember) Android.Gms.Location LocationServices.get_SettingsApi () Plugin.Geofence GeofenceImplementation.IsLocationEnabled (System.Action1[T] returnAction) Plugin.Geofence.GeofenceImplementation Plugin.Geofence.GeofenceImplementation..ctor () [0x00032] in <70d71c13fc584d2a938433caf7e25ac4>:0 Plugin.Geofence CrossGeofence.CreateGeofence () Plugin.Geofence.CrossGeofence+<>c <.cctor>b__55_0 () System Lazy1[T].PublicationOnlyViaFactory (System.LazyHelper initializer) System Lazy1[T].CreateValue () System Lazy1[T].get_Value () Plugin.Geofence CrossGeofence.get_Current () Dispatch.Mobile.Core.Services.Data GeofenceDataService.StartGeoFenceMonitoring (System.String orderNumber) Dispatch.Mobile.Core.ViewModels.PendingOrderViewModel StartOrderPageViewModel.StartGeoFencingServices () Dispatch.Mobile.Core.ViewModels.PendingOrderViewModel StartOrderPageViewModel.StartNewOrder () java.lang.NoSuchFieldError: no "Lcom/google/android/gms/location/SettingsApi;" field "SettingsApi" in class "Lcom/google/android/gms/location/LocationServices;" or its superclasses crc643f46942d9dd1fff9.ButtonRenderer_ButtonClickListener.n_onClick(Native Method) crc643f46942d9dd1fff9.ButtonRenderer_ButtonClickListener.onClick(Unknown Source:0) android.view.View.performClick View.java:7201 android.view.View.performClickInternal View.java:7170 android.view.View.access$3500 View.java:806 android.view.View$PerformClick.run View.java:27562 android.os.Handler.handleCallback Handler.java:883 android.os.Handler.dispatchMessage Handler.java:100 android.os.Looper.loop Looper.java:214 android.app.ActivityThread.main ActivityThread.java:7682 java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:516 com.android.internal.os.ZygoteInit.main ZygoteInit.java:950

android options

alanhoman commented 2 years ago

I am having the same issue and had to revert back to 1.5.7.