African swine fever was detected in several animals outside Barcelona in the country's first outbreak since 1994.