I used map calculator and first created a raster with following:

Con(cropland == 1, precipitation, NULL)

Then using the raster created, I did a zonal statistics with district shape file as feature and raster as input raster