No shadow on terrain when built

Hi guyz, I have an issue with Unity.

I got a scene with a terrain, trees, grass and the sun. On Scene and Game view, shadows are cast on the terrain and the grass but when I build, the shadow only cast on grass and trees, not on the terrain.
I can’t bake the terrain because my trees are moving because of the wind, so it’s realtime shadow…

Surprisingly I solved the problem by baking the scene. It seems like baking is necessary even for dynamic shadows

Import the latest Standard Assets package, delete the Library folder insider your project and fix all errors, before rebuilding. It fixed the bug for me.