potential fix for the rare mapbox native crash (use onDestroyView)

1.2-legacy
Kevin Hester 2021-02-01 22:54:04 +08:00
rodzic f44d9b16b1
commit 719bef7889
3 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -156,7 +156,7 @@ dependencies {
implementation 'com.github.mik3y:usb-serial-for-android:v3.0.0'
// mapbox
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.5.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.6.0'
// mapbox specifies a really old version of okhttp3 which causes lots of API warnings. trying a newer version
implementation 'com.squareup.okhttp3:okhttp:4.9.0'

Wyświetl plik

@ -30,6 +30,10 @@
-keep class com.geeksville.mesh.**{*;}
-keepclassmembers class * extends com.google.protobuf.GeneratedMessageLite { <fields>; }
# Recommended by mapbox to prevent native crashes
-dontwarn com.mapbox.**
-keep class com.mapbox.** { *; }
# for kotlinx.serialization
-keepattributes *Annotation*, InnerClasses
-dontnote kotlinx.serialization.SerializationKt

Wyświetl plik

@ -204,9 +204,9 @@ class MapFragment : ScreenFragment("Map"), Logging {
mapView?.onResume()
}
override fun onDestroy() {
override fun onDestroyView() {
mapView?.onDestroy()
super.onDestroy()
super.onDestroyView()
}
override fun onSaveInstanceState(outState: Bundle) {