SOLUTION: The word “day” (yom) does not always mean a 24-hour day. For “one day (yom) is as a thousand years” (Ps. 90:4; cf. 2 Peter 3:8). Adam did die within a “day” in this sense. Further, Adam began to die physically the very moment he sinned (Rom. 5:12), and he also died spiritually the exact instant he sinned (Eph. 2:1). So Adam died in several ways, any one of which would fulfill the pronouncement of God (in Gen. 2:17).
Geisler, N. L., & Howe, T. A. (1992). When critics ask : A popular handbook on Bible difficulties (34). Wheaton, Ill.: Victor Books.