Preheat oven to 350°F. Grease a 13x9-inch pan with cooking spray or butter.
In a large bowl, whisk together the oil and sugar. Add the eggs and 1 teaspoon vanilla, and whisk to combine.
½ cup oil, 2 cups sugar, 2 eggs, 1 teaspoon vanilla
Add the flour, baking soda, cinnamon, and salt. Stir gently just until incorporated.
2 cups flour, 2 teaspoons baking soda, ½ teaspoon cinnamon, ¾ teaspoon salt
Fold in the apples and walnuts.
4 cups peeled and diced apples, 1 cup chopped walnuts
Pour the mixture into the prepared pan and spread into an even layer.
Bake for 40 minutes, or until a toothpick inserted into the center comes out clean. (When you put the cake into the oven, take out the butter and cream cheese for the frosting out of the refrigerator so it’s room temperature when you’re ready to frost the cake.)
Let the cake cool completely after baking.
Place the softened butter and softened cream cheese in a large bowl. Mix with a hand mixer until light and fluffy.
½ cup (1 stick) unsalted butter, , 8 oz cream cheese,
Add the vanilla, powdered sugar, and salt. Mix until combined.
1 teaspoon vanilla extract, 3 cups powdered sugar, Pinch of salt
Spread the frosting in an even layer on top of the apple cake.
Serve right away or refrigerate before serving.
Notes
You can use almost any variety of apple that you like here, except for Red Delicious and Gala, which don't bake well into cakes (they get mushy). I used Envy apples.Store any leftover cake in the refrigerator. It'll keep well for 3–4 days. After that, it could get soggy from the moisture in the apples. You can also freeze the cake for up to two months.I like bringing the cake/frosting to room temperature before serving.