To solve the given optimization problem, we first need to convert the natural language description into a symbolic representation. This involves defining variables, an objective function, and constraints based on the problem statement.

Let's define:
- $x_1$ as the number of strawberry ice cream cakes made.
- $x_2$ as the number of mint ice cream cakes made.

The objective function is to maximize profit. Given that the profit per strawberry ice cream cake is $2.5 and per mint ice cream cake is $4, the objective function can be written as:
\[ \text{Maximize: } 2.5x_1 + 4x_2 \]

The constraints based on the problem description are:
1. The ice cream truck must make at least 10 cakes of strawberry ice cream but cannot make more than 20 cakes.
   - $10 \leq x_1 \leq 20$
2. It must also make at least 20 mint ice cream cakes but cannot make more than 40 cakes.
   - $20 \leq x_2 \leq 40$
3. In total, the ice cream truck can make at most 50 total cakes.
   - $x_1 + x_2 \leq 50$

All variables are non-negative since they represent quantities of ice cream cakes.

In symbolic representation, this problem can be summarized as:
```json
{
  'sym_variables': [('x1', 'strawberry ice cream cakes'), ('x2', 'mint ice cream cakes')],
  'objective_function': '2.5*x1 + 4*x2',
  'constraints': ['10 <= x1 <= 20', '20 <= x2 <= 40', 'x1 + x2 <= 50']
}
```

Now, let's write the Gurobi code in Python to solve this optimization problem:
```python
from gurobipy import *

# Create a new model
m = Model("IceCreamCakes")

# Define variables
x1 = m.addVar(lb=10, ub=20, vtype=GRB.INTEGER, name="strawberry")
x2 = m.addVar(lb=20, ub=40, vtype=GRB.INTEGER, name="mint")

# Set the objective function
m.setObjective(2.5*x1 + 4*x2, GRB.MAXIMIZE)

# Add constraints
m.addConstr(x1 + x2 <= 50, "total_cakes")

# Optimize model
m.optimize()

# Print solution
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print(f"Strawberry ice cream cakes: {x1.x}")
    print(f"Mint ice cream cakes: {x2.x}")
    print(f"Total profit: {m.objVal}")
else:
    print("No optimal solution found")
```