Why are my tomatoes producing flowers but no fruit?
Fruit Set - The transition of a flower into a young fruit is very sensitive to several environmental factors over which gardeners have some control.
Following is a brief discussion of some of the causes of poor tomato fruit set with emphasis on urban gardening:
Temperature and Humidity: Daytime temperatures above 90°F and night temperatures above 70°F result in reduced flowering and fruit set. There is considerable evidence that night temperature is the critical factor in setting tomato fruit, the optimal range being 59° to 68°F. With night temperatures much below or above this critical range, fruiting is reduced or absent. Low temperatures reduce the production and viability of pollen. High temperature, especially if accompanied by low humidity and moisture, hinders fruit set through failure in pollination and/or fertilization.
Plant Nutrition: Reduced fruiting may result from either stunted or excessively vigorous vegetative growth. Injury from disease and insects, especially sucking insects such as aphids and thrips, can severely check growth. Inadequate moisture and/or available nitrogen can hinder growth and flower production. Conversely, abundant water and nitrogen can stimulate rapid vegetative growth with low levels of carbohydrates remaining for the normal processes involved in fruit set.
Garden sites located on heavy subsoils are infertile and poorly drained. Gardeners create faulty nutrition by either not applying any fertilizer or by adding too much. In addition, water for irrigation is often not available during times of drought.
Photoperiod (length of day): Although the tomato plant can flower and fruit at any daylength (day neutral plant), fruit set has been shown to be retarded under continuous light. Thus, tomato fruit set may be reduced under the continuous illumination characteristic of some environments.
References
https://www.pubs.ext.vt.edu/content/dam/pubs_ext_vt_edu/426/426-418/426-418_pdf.pdf