Message Oracle PLS-00651 - implementation type in Aggregate/Table function should be a valid type

ERRORimplementation type in Aggregate/Table function should be a valid type
CAUSEUser tried to use some other database object like a package to define implementation type of an aggregate/table function.
ACTIONUse a valid user defined type as implementation type.