MyLocation is only available after you have requested the permission with Runtimepermissionslib.
You should not set MyLocationEnabled to true in the designer.
Instead load the map with the setting OFF.
In myp ready you then can rewquest the permission. If permission is set you then can set the Flag to True.