-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Labels
bugA bug is found inside the code base and should be immediately brought to attention ASAPA bug is found inside the code base and should be immediately brought to attention ASAPplaces-pluginIssues that deal with the places plugin moduleIssues that deal with the places plugin module
Description
There is a known issue with the AndroidX migration tool in Android Studio that fails to update the XML for BottomSheetBehavior in projects. (See Stack Overflow discussion.)
Unfortunately our Places Plugin was not spared by this issue and will crash if you use the Place Picker on AndroidX.
Example crash:
2019-04-03 11:26:47.146 16098-16098/com.your.androidapp E/AndroidRuntime: FATAL EXCEPTION: main Process: com.your.androidapp, PID: 16098 java.lang.IllegalArgumentException: Illegal state argument: 5 at com.google.android.material.bottomsheet.BottomSheetBehavior.startSettlingAnimation(BottomSheetBehavior.java:1059) at com.google.android.material.bottomsheet.BottomSheetBehavior.startSettlingAnimationPendingLayout(BottomSheetBehavior.java:846) at com.google.android.material.bottomsheet.BottomSheetBehavior.setState(BottomSheetBehavior.java:825) at com.mapbox.mapboxsdk.plugins.places.picker.ui.CurrentPlaceSelectionBottomSheet.toggleBottomSheet(CurrentPlaceSelectionBottomSheet.java:80) at com.mapbox.mapboxsdk.plugins.places.picker.ui.CurrentPlaceSelectionBottomSheet.setPlaceDetails(CurrentPlaceSelectionBottomSheet.java:55) at com.mapbox.mapboxsdk.plugins.places.picker.ui.PlacePickerActivity.onCameraIdle(PlacePickerActivity.java:158) at com.mapbox.mapboxsdk.maps.CameraChangeDispatcher.executeOnCameraIdle(CameraChangeDispatcher.java:140) at com.mapbox.mapboxsdk.maps.CameraChangeDispatcher.access$300(CameraChangeDispatcher.java:21) at com.mapbox.mapboxsdk.maps.CameraChangeDispatcher$CameraChangeHandler.handleMessage(CameraChangeDispatcher.java:169) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:163) at android.app.ActivityThread.main(ActivityThread.java:6238) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
Fortunately this should be an easy fix since we only need to modify this line of our XML:
mapbox-plugins-android/plugin-places/src/main/res/layout/mapbox_view_bottom_sheet_container.xml
Line 50 in 67efb48
| app:layout_behavior="android.support.design.widget.BottomSheetBehavior"> |
cc: @mapbox/maps-android
radeshf and mastrgamr
Metadata
Metadata
Assignees
Labels
bugA bug is found inside the code base and should be immediately brought to attention ASAPA bug is found inside the code base and should be immediately brought to attention ASAPplaces-pluginIssues that deal with the places plugin moduleIssues that deal with the places plugin module