-Take time off, doing other things that don't aggrevate, till completely better. Only when better can the following be done to accurately determine the source(s) of the problem:
-Once better, use a process of elimination. Just use the treadmill for a few weeks or a month, then only run for a few weeks or a month, but not both-find out which is causing the problem.
Once the cause is isolated and a little more time is taken to again let the pain subside, either avoid the exercise, or first try to modify the exercise to work around the problem.
For example when running try a grass surface and/or possibly upgrade sneakers.
With treadmill, try different inclines, which will shift the emphasis/strain on the legs.
Try slightly different form/pace-when i took shorter steps, the center of gravity shifted away from the front of the foot & off the shins.
Always ensure an adequate warmup. 3-4 minutes of walking at a good pace, standing on toes for reps, stretches, etc. then into the running.
-Only when nothing helps, entirely avoid the exercise & use substitutes - treadmill, actual running, elliptical, etc.