This error message can occur even when the general-purpose pin count reported does not exceed the number of available general-purpose pins if you use the reserved function of any dual-purpose I/O pin.
You can use dual-purpose pins as general I/O or as reserved pins (such as DEV_OE or DEV_CLR). These pins are included in the count for the maximum general-purpose I/O pins available (N in the above error message). Using a dual-purpose pin for its reserved function means that the pin is no longer available for general-purpose user I/O.
To achieve a sucessful fit, use a device with a higher general-purpose I/O pin count or reduce the I/O pin usage in your design.