getSupportFragmentManager().getFragments() shows a compile time error

Calling getSupportFragmentManager().getFragments() shows a compile time error with the message below: getSupportFragmentManager().getFragments() can only be called from within the same library...