In the US, working for free is illegal and hence a minefield when the company goes to attract outside investment. If that weren't enough, everyone should be on a multi-year vesting schedule including the founder [you work for a year, get 20,000,000 shares and the founder stops working, and then what?] Finally, the stocks are only worth your salary if you can sell them, but who will buy them at face value? If the company can buy them, then they can pay your salary.
To put it another way, if you're going to work for a year for no salary, and you are capable of building the software for an Uber for X from scratch, why not just build your own Uber for Y? And to put it a third way, suppose your former colleague was asking you to give him the next year's worth of paychecks from your current job in exchange for equity a year from now. Would that be a good deal to consider?
Good luck.