Only if they stop giving it back to their shareholders. Since they started their buyback program in 2012 Apple has 'returned' over $222 billion to shareholders [0]. Presently they are issuing debt to finance the buybacks & dividends. If they are not careful they may end up like IBM.
It's true that Apple has mountains of cash, but in all likelihood, a failing Apple-sized tech giant would end up acquired by an adjacent company (see Motorola or Yahoo or Sun Microsystems
) before they ran out of money.
[0] https://www.macrumors.com/2017/09/05/apple-5b-bond-sale-fund...