Think about the problem at hand first and foremost. If you blindly apply the principles of YAGNI or SOLID, you can hurt yourself later on. Something that I hope we can all understand is that there is no "one" design approach that fits all problems. You can see evidence of that when a store sells a hat advertised as "one size fits all", but it doesn't fit your head. It's either too big or too small.
Instead, it's better to understand the principles and problems that SOLID is attempting to address; as well as the principles and problems that YAGNI is attempting to address. You'll find that one is concerned with the architecture of your application and the other is concerned with the development process as a whole. While there can be overlap in some cases, they are distinctly different problems.
YAGNI (You Ain't Gonna Need It [quaint American acronym]) is concerned with saving developer time adding steel re-inforced concrete foundations to a bridge that is only intended to span a 3 foot wide creek when a simpler wooden bridge will do just fine. If we are spanning a mile wide river and needing to support several tractor trailers, of course we would need that extra foundation work. In essence, YAGNI is telling you to look at the bigger picture and design for the current needs. It is addressing the problem of making something too complicated because we are anticipating a number of potential needs that the customer hasn't identified yet.
SOLID is concerned with how we make sure the pieces of the bridge fit together properly, and can be maintained over time. You can apply SOLID principles to the wooden bridge as well as the steel re-inforced concrete bridge.
In short these two concepts are not necessarily in conflict with each other. When you come across a situation where you believe that they are, it's time to take a look at the big picture. Depending on your conclusion, you might decide to do away with a portion of the SOLID principles or you might decide that you really do need it.