When I get an erection, I can't fully retract my foreskin over the glands of my penis. Why is this? Is there any solution? I'm uncircumcised. Thanks

Yes. First i would use a prescription strength steroid cream to apply to the foreskin twice a day. That may allow the opening to relax and the foreskin to retract. Alternatively, a circumcision or a preputioplasty which are surgical procedures to relieve the foreskin tightness.