The building was evacuated and nobody was injured, the police said, but heavy smoke and the possibility of burning chemicals led officials to close local schools.