@shin_getter - A good argument. However, having insight into Kosovo there were several other issues that precluded Apache operations. The administration at the time was very much into zero casualties (painless war), the Air Component Commander was in charge of all operations and had little understanding of attack helicopter operations to be mild, compounded by the instructions from the Commander in Chief. Finally the shortcoming of training of the Apache crews for the environment (alpine/high altitude) was made apparent from two crashes. There were a number of causal factors involved that led to the decision. Again it was the perennial argument of helicopters viability. Finally your argument rest on a sample size of one. If you could indicate to me the numerous other cases where attack helicopter operations were stood down due to he threat I would be interested in hearing of them.
I would agree with you that cruise missiles and some fixed wing (A-29, T-6) are cheaper but would take issue that they are more survivable against a threat designed specifically for cruise missiles. The reason cruise missiles use terrain masking is to hide from radars, just like helicopters. As mentioned previously radars to date are unable to see through granite and most are hampered by clutter created by trees and urban areas. As mentioned there are likely to be just as many things hunting radars as there are radars. From what I take to be your position on the shear volume of air defenses and unmanned things, I think this situation only occurs at the very beginning of major combat. Air defenses are not singularly focused on dealing with helicopters, especially as helicopters are not typically trying to kill critical nodal targets deep in the defended territory. They might not even be the priority of the air defense command. Air defenses do not just blast anything and everything that shows up on the radar for the reason I mentioned above that you did not counter: LOGISTICS. There are a finite number of missiles, cannon rounds, and fuel. Rearming a air defense system is a very time consuming effort, even for a well trained crew. So air defense commanders have to be very particular with how they expend their ammunition. C-RAM is usually an air defense system, optimized to deal with ballistics threats at critical locations (as mentioned above), they are not found forward in numbers. Even the tactical C-RAM is focused on point protection and are not numerous. C-RAM is also a line of sight weapon, its radar does not see through trees, building or mountains. There is also of course the curvature of the earth. There is a mathematical equation I have forgotten that tells you how far you can see at distances above the ground.
Sensors are always improving to be sure and will certainly increase the challenge for ALL flying things, but then the sensors on the flying things are always improving as well. Recent changes to the Apache Longbow have likely taken into account that potential competent combatants have investing in small unmanned systems. I do agree with you that as sensors improve dealing with small flying threats would be best dealt with by sensor guided proximity fused auto-cannon. I suspect this capability is either possible or soon will be possible for those countries that produce high end attack helicopters.
Directed energy (DE) is likely to be the next Maxim gun, across the spectrum of military operations. DE is far more deadly to optics and sensor components, than physically burning something out of the air. So while any modern tank is not likely to be blown up by DE it can be blinded, which makes it almost useless. DE remains sensitive equipment, that does not do well with rough movements and typical soldier maintenance, both of which are normal in any military operation. This of course will likely change as time goes on, but I do think DE weapon systems are still a few decades from full tactical viability. There is also DE that is rapidly being developed to counter UAV by interrupting the signals internal to the vehicle or to break lock with whomever is controlling/receiving data from said UAV. Since there is no one to manually maintain flight operations of the flying thing, they tend to use whatever the last command was which rapidly ends up on the ground or an automatic "return to launch point". There is no free lunch. These weapons are proliferating rapidly.
All of this said though, I do agree with you in that at some point attack helicopters as we know them will be much less useful in major combat operations (at least until all the robots kill each other off in the first 3.25 seconds of the war), and are likely to become very fast artillery flying to points to launch longer ranged small cruise missiles or loitering munitions and then retiring. However since major combat operations are a very high stakes, phenomenally expensive, poker games that most do not want to play I think that most military operations are likely to be foisted on the poorer people of the world, who cannot afford high end. Of course it is more likely to be like Yemen than Somalia. Here attack "rotor-craft" will still likely be around to support the poor bloody infantry.