Preheat oven to 350°F (175°C). Grease a 9x13-inch baking dish or similar size.
In a large bowl, combine the sliced apples with granulated sugar, flour, cinnamon, nutmeg, and lemon juice. Toss until evenly coated. Spread the mixture into the prepared baking dish.
In another bowl, combine oats, flour, brown sugar, salt, and cinnamon. Add cold butter cubes and cut in with a pastry cutter or your fingers until the mixture resembles coarse crumbs. Stir in pecans and cranberries if using.
Sprinkle the topping evenly over the apple mixture.
Bake for 40–45 minutes, until the topping is golden brown and the apples are bubbly.
Remove from the oven and let cool for about 10 minutes before serving.
Serve warm with a scoop of vanilla ice cream if desired.