Preheat oven to 350 degrees F. Grease a 9x5-inch loaf pan.
In a large bowl, stir together the apples, sugar and oil. Add the egg and mix well. Sift the flour, baking powder, baking soda and cinnamon into the apple mixture. Stir just until the dry ingredients are moist. Gently stir in the cranberries and walnuts (if using).
Turn the batter into the prepared loaf pan and spread into an even layer (it is a very thick batter, almost like cookie dough). Bake until golden brown and a toothpick inserted into the center comes out clean, 35 to 45 minutes. Cool for 15 minutes in the pan, then turn out onto a cooling rack to cool completely. Leftover bread should be wrapped in plastic wrap and stored at room temperature for up to 3 days.