
Plants that flower but do not fruit typically are having a problem either with maturity - guavas for example need to be 4 or 5 years old to fruit - or lack of pollinators. You can try hand pollinating, or plant other things that will attract more bees. These articles might be useful: https://www.gardeningknowhow.com/edible/fruits/guava/growing-guava-fruit-trees.htm
https://www.gardeningknowhow.com/garden-how-to/beneficial/attracting-bees.htm
https://www.gardeningknowhow.com/garden-how-to/beneficial/insect-pollination-process.htm