How do I fix an error when importing a heightmap?

Hi I created a heightmap (raw) in World Builder, and when I try to import it I get this strange error:
ArgumentException: Destination array is not long enough to copy all the items in the collection. Check array index and length.

And it will not build my terrain the whole error is like 20 lines so I will not post it here. The map resolution is 512x512. Any help would be appreciated. I have the latest version of unity too.

RAW Terrain heightmaps must have dimensions of powers of two + 1. Change your map size to 513x513.