The Catalan language is in danger of extinction in Barcelona and its region. Especially among young people the numbers are dramatic. My personal opinion on a few of the causes.

1. Role models: many of the most successful people of the country will almost always use Spanish to talk in public. From Marc Marquez to Rafael Nadal to the players of FC Barcelona.
Even key figures of the indy movement, born and raised in Catalonia, will after 38 years still nearly exclusively use Spanish for their public speeches, being rewarded with a very well paid job in Madrid. A strong Spanish-minded message to youngsters and newcomers.
2. Social media: young people want to be seen and have impact. And with social media that often means to have an audience as broad as possible. This is where Spanish comes in. Very much connected to the education system.
The Catalan education system (with which I don't refer only to schools) seems oriented towards making sure Catalan students finish with very high proficiency in Spanish, and an almost inexistent proficiency in German, French and English.
Even when the Spanish market has a very high unemployment rate and the economy is based on low paid jobs and poor consumers. The future of Spanish is not dependent on the Catalan education system, whereas the future of the Catalan language and the future of the youngsters is.
3. Mentality: it's seen as normal to switch from Catalan to Spanish in order to make it easier for the other person. Whereas the opposite nearly never happens.
This experiment already happened in "bilingual" Brussels, where one community always changed language and the other one didn't. Until the moment where we can now say Brussels is a mainly monolingual city and Dutch disappeared as a social language in the city.
Every time one changes from Catalan to Spanish, be it obligated (in EU parliament, in Spanish Congress, in front of a judge) or voluntary in the street or a university classroom, is a missed opportunity for the other person to practise and learn it.