Heat the oven to 375ºF. Coat a 2-quart baking dish (an 8-by-8-inch size works well) with cooking spray or butter.
In a large bowl, toss together the apples, cranberries, granulated sugar, lemon juice, and 2 tablespoons of flour. Pour the mixture into the prepared baking dish.
In a food processor, combine the pistachios, brown sugar, oats, cinnamon, salt, butter, and remaining ½ cup of flour. Pulse until the mixture resembles coarse crumbs.
Spread the topping over the fruit and bake until golden brown and bubbly, 35 to 45 minutes.
Tip: If you don’t have pistachios, use pecans, walnuts, or almonds instead.