Preheat oven to 325° and grease a 9 inch square baking dish.
Pour the crushed pineapple into a strainer to drain while you prepare the other ingredients.
Melt the 2 tablespoons of margarine and beat it together with the 1/4 cup sugar.
Add the egg and beat again.
Combine the flours, starches, xanthan gum, baking soda and baking powder in a small bowl. Add them to the mixing bowl and mix well. It will form a sticky dough.
Press this into the bottom of the dish. Running cold water over a silicone spatula and then using it to press the dough helps to keep it from sticking. You want to get the dough out to the edges, but don’t worry about it being smooth.
Use a spoon the stir the pineapple and give it a few squeezes, then let it drain some more.
Make the topping by melting the 1 tablespoon of margarine and beating with the 1 cup sugar.
Add the eggs and beat again.
Stir in the coconut.
Squeeze the pineapple a little more. I removed about 1 1/3 cups of juice from mine. Then drop it by spoonfuls onto the dough in the baking dish, distributing it evenly over the dough.
Spread the topping over the pineapple, pushing it to the edges.
Bake at 325° for 35-40 minutes.
Remove the dish from the oven and place it on a wire rack to cool.
Cut into bars.
Recipe by The Gluten-Free Homemaker at http://glutenfreehomemaker.com/coconut-pineapple-bars/