NAXAM / mapbox-xamarin-forms

Mapbox on Xamarin.Forms
Apache License 2.0
73 stars 41 forks source link

App Crash on Android 11 #112

Open bbenetskyy opened 3 years ago

bbenetskyy commented 3 years ago

Naxam.Mapbox.Forms v1.0.8.3

Xamarin.Forms v5.0.0.2012

Xamarin.AndroidX.AppCompat v1.2.0.7

Xamarin.AndroidX.MediaRouter v1.2.2.1

Xamarin.AndroidX.Migration v1.0.8

Xamarin.Google.Android.Material v1.3.0.1

image

image

  at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x0008e] in <94b04e1756104d1fa1d144932ae2720c>:0 
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00063] in <94b04e1756104d1fa1d144932ae2720c>:0 
  at AndroidX.Fragment.App.Fragment.OnViewCreated (Android.Views.View view, Android.OS.Bundle savedInstanceState) [0x00049] in D:\a\1\s\generated\androidx.fragment.fragment\obj\Release\monoandroid9.0\generated\src\AndroidX.Fragment.App.Fragment.cs:2660 
  at Naxam.Controls.Mapbox.Platform.Droid.MapViewFragment.OnViewCreated (Android.Views.View view, Android.OS.Bundle savedInstanceState) [0x00000] in <ea13acee05bf414192f14b0a9d405ec6>:0 
  at AndroidX.Fragment.App.Fragment.n_OnViewCreated_Landroid_view_View_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_view, System.IntPtr native_savedInstanceState) [0x00018] in D:\a\1\s\generated\androidx.fragment.fragment\obj\Release\monoandroid9.0\generated\src\AndroidX.Fragment.App.Fragment.cs:2647 
  at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.142(intptr,intptr,intptr,intptr)
  --- End of managed Java.Lang.SecurityException stack trace ---
java.lang.SecurityException: getDataNetworkTypeForSubscriber
    at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
    at android.os.Parcel.createException(Parcel.java:2357)
    at android.os.Parcel.readException(Parcel.java:2340)
    at android.os.Parcel.readException(Parcel.java:2282)
    at com.android.internal.telephony.ITelephony$Stub$Proxy.getNetworkTypeForSubscriber(ITelephony.java:8762)
    at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3021)
    at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:2985)
    at com.mapbox.android.telemetry.TelemetryUtils.obtainCellularNetworkType(TelemetryUtils.java:143)
    at com.mapbox.mapboxsdk.module.telemetry.PhoneState.<init>(PhoneState.java:39)
    at com.mapbox.mapboxsdk.module.telemetry.TelemetryImpl.onAppUserTurnstileEvent(TelemetryImpl.java:46)
    at com.mapbox.mapboxsdk.maps.MapView.onCreate(MapView.java:277)
    at com.mapbox.mapboxsdk.maps.SupportMapFragment.onViewCreated(SupportMapFragment.java:112)
    at crc647daf67f241006816.MapViewFragment.n_onViewCreated(Native Method)
    at crc647daf67f241006816.MapViewFragment.onViewCreated(MapViewFragment.java:32)
    at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:2974)
    at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:543)
    at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
    at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2177)
    at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2088)
    at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1990)
    at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:524)
    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:7656)
    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)
bbenetskyy commented 3 years ago

https://github.com/mapbox/mapbox-gl-native-android/issues/425#issuecomment-680753940

that is fixed under new com.mapbox.mapboxsdk:mapbox-android-telemetry:6.1.0 package version

Temporary work-around:

  1. Change Target Version to 29
  2. Add READ_PHONE_STATE permission to the app
sonjz commented 3 years ago

hmm june 1st, is this no longer maintained?

TheManDK commented 2 years ago

Still no update? Now Google is requiring API 30 as a minimum on Play Store.

sonjz commented 2 years ago

@TheManDK pretty sure this is dead, guessing author moved on to a more modern framework. We are using latest API 30, but had to make workaround to catch the exception whenever the widget was used and display appropriate messaging for READ_PHONE_STATE permission changes. Not at all ideal.

TheManDK commented 2 years ago

@TheManDK pretty sure this is dead, guessing author moved on to a more modern framework. We are using latest API 30, but had to make workaround to catch the exception whenever the widget was used and display appropriate messaging for READ_PHONE_STATE permission changes. Not at all ideal.

Not at all, we also currently have a msg box telling the user that we need this permission. I have contacted the author and asked if we can hire them to fix the issue