Of course there is, this is what tax evasion is about. There's a decent case to be made that the Apple and Ireland were wrong in Apple following Ireland's tax code, we'll see how the case turns out on appeal.
I would say that when the sovereign is in agreement the payment of taxes that it can't be construed as evasion, however, I'm not super well versed on how much of a sovereign Ireland really is given it's membership in the EU. Perhaps the EU is the real sovereign in this case and Apple has erred in consulting with the Irish government who lacks authority to set tax policy in its territory.
I would say that when the sovereign is in agreement the payment of taxes that it can't be construed as evasion, however, I'm not super well versed on how much of a sovereign Ireland really is given it's membership in the EU. Perhaps the EU is the real sovereign in this case and Apple has erred in consulting with the Irish government who lacks authority to set tax policy in its territory.