I am trying to load Google Maps inside fragment ,and I keep getting the same error regardless of what solution I am trying to implement. I have already gone though all of t
line 66 of your MapsFragment, replace:
// Try to obtain the map from the SupportMapFragment.
mMap = ((SupportMapFragment)getFragmentManager().findFragmentById(R.id.map))
.getMap();
by:
// Try to obtain the map from the SupportMapFragment.
mMap = ((SupportMapFragment)getChildFragmentManager().findFragmentById(R.id.map))
.getMap();
Because your map fragment is a fragment in a fragment, and not managed by the top level FragmentManager.
Also, I am not sure but you may want to setup your Map asynchronously:
((SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map)).getMapAsync(
new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
setUpMap();
}
});