It does not matter whether fireball is an attack or not. It _does not hit_.
For Uncanny Dodge, I tend to think you are right. GMforPowergamers is right in that "attack" isn't well-defined. Over on the Wizards boards, this came up and people focused on what an attack is; going by the definition of an attack requiring an attack roll, an invisible dragon does -not- lose invisibility when using its breath weapon.
Does that seem right to you?