'Cannot resolve method 'mapId' in 'GoogleMapOptions' trying to add new map style

I am trying to add a new created Google maps style but I get the error "Cannot resolve method 'mapId' in 'GoogleMapOptions'

I have been following this google maps guide: https://developers.google.com/maps/documentation/get-map-id?hl=es-419#java

This is the code where the error is happening:

        MapFragment mapFragment = MapFragment.newInstance(
            new GoogleMapOptions()
                    .mapId(getResources().getString(R.string.map_id)));

I have map_id in the string file and it recognize the string. Thank you!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source