- First, **check if your transaction's setup(gas/gas limit) is ok** (see [this][1]).

 - If everything is okay, **the most probable issue might be the size of your contract**. I suggest first take a look at [this][2] to get familiar with **contract deployment's gas calculation**.

 - Now, note that **each block has a limited size**([currently it is 15 million gas][3]). This means that you cannot send transactions with more than this size. Which means that there is a limit for gas, too. (See these links: [1][4], [2][5], [3][6])

 - After reading the aforementioned links, I suggest (if it is possible for you (which seems to be a MUST TO DO)), **minimize your solidity code** as much as possible. Removing extra codes, results in less bytecodes, which means you will not exceed the gas limit. Be warned that decreasing the volume of your code should not result in decreasing the security and functionality of your code.

I hope this helps you.

  [1]: https://ethereum.stackexchange.com/questions/1832/cant-send-transaction-exceeds-block-gas-limit-or-intrinsic-gas-too-low
  [2]: https://ethereum.stackexchange.com/a/37898/86679
  [3]: https://ethereum.org/en/developers/docs/blocks/
  [4]: https://legacy.ethgasstation.info/blog/ethereum-block-size/
  [5]: https://ethereum.stackexchange.com/questions/1106/is-there-a-limit-for-transaction-size/1110
  [6]: https://ethereum.stackexchange.com/questions/50283/why-is-there-block-gas-limit