Barcelona would seem like the perfect market for web-based collaborative consumption firms like Airbnb and Uber. Spain’s second city is a hip tourist destination with a large population of young foreigners and a burgeoning tech sector.

And up until now, it has been. Depending on the month, Barcelona is Airbnb’s third or fourth largest market, tied with London behind New York and Paris. And while Uber only entered the city in April, it was greeted with fanfare.

But Barcelona has become a headache for the popular residence and ride-sharing platforms, ground zero in a fight over how collaborative consumption should be regulated and taxed.

Taxi drivers have asked Barcelona’s local government to shut down Uber because of what they see as unfair competition from unlicensed, untaxed drivers. Hotel unions have made similar complaints about Airbnb, and local residents have objected to the proliferation of unlicensed tourist apartments.

And the government has begun to listen.

MORE: China Mobile has its sights set on the U.S. wireless market

“All this activity has to be legalized and be moved in the tax-paying world so as not to create unfair competition,” says Barcelona Second Deputy Mayor Sònia Recasens.

At a recent e-commerce conference at Barcelona’s IESE Business School, representatives of Airbnb and Uber played down the conflict as the typical fuss when a disruptive business enters a heavily regulated industry. In reality, they said, their services can help the city and aid these sectors.

Jeroen Merchiers, Airbnb’s Barcelona-based general manager for Spain and Portugal, said that last year rentals through his firm had a $128 million impact in Barcelona, much of which helped struggling locals: 77% of the hosts rented out one room in their home and earned an average of 220 euros a month, he said, most of which went toward basic needs.

“In southern Europe, people are struggling. Fifty three percent of the hosts say the money they make as a host allows them to stay in the room or house where they are,” he says. “Thousands of families are using this to make ends meet.”

For his part, Uber’s general manager for North and West Europe, Pierre-Dimitri Gore-Coty, said that he understood the taxi drivers’ fears but argued that Uber’s growth was part of a structural transition away from personal cars, which, in the long run, would help taxis.

“Very often, we hear that Uber is competing with taxis, and I think when you focus on that, you miss the bigger picture, which is the trend to more shared resources, which could be taxis,” he says. “Guys who drop their car use taxis more than ever.”

In recent years, Barcelona has experienced a huge tourist boom — in fact, tourism now accounts for some 14% of the local economy — and is looking to organize it in a way that will be profitable without destroying the city’s identity. A growing number of locals have begun to complain about rowdy tourists staying in unlicensed rentals, especially in the city ‘s historic old city, the Ciutat Vella (a documentary on YouTube, Bye Bye Barcelona, traces the downside of the city’s tourist boom).

“We have 1.6 million inhabitants here and 27 million tourists visit us,” says Recasens. “What is evident in this ratio is we have to find some agreement between locals and visitors.”

On May 2, the city put into place a temporary freeze on new tourist housing licenses, which are required for people who want to rent out their apartments. There are about 8,000 in the city, including 604 in the Ciutat Vella.

According to Recasens, the city aims to have a new urban plan in place in July, when it will reopen licenses in neighborhoods that aren’t saturated. She said the city also plans to open a tourist apartment hotline, where locals can call to complain about problem rentals. Unlicensed tourist apartments could be fined up to 90,000 euros.

The city has run into conflict with Airbnb over these kinds of regulations. While a new regional rule requires companies offering tourist rentals to post their license number on online listings, Airbnb does not require its hosts to do so, arguing that it does not offer the rentals directly.

MORE: Google to build self-driving car – no steering wheel necessary

“We’re a technology platform that puts two people in touch. We don’t have the capacity to verify who is complying with the law,” Merchiers says. “But every host signing up on Airbnb confirms that he understands local regulations. It’s up to him.”

That’s not enough for Recasens.

“They hide in a judicial limbo or behind laws that protect ecommerce,” she says. “It’s not fair that one can hide behind e-commerce in order to not comply with the law.”

Uber has run into problems with the city because it puts ride-share clients in contact with unlicensed drivers who compete with taxi drivers who must pay for licenses that cost some 100,000 euros.

“We have thousands of taxi drivers who live from their taxi licenses,” says Recasens. “I can understand that some people want to make a little extra [on Uber] because they’re having a tough time, but they have to understand that this is unfair competition with families that have the same right to earn a living.”

After the local taxi union complained, the regional government of Catalonia opened an investigation into Uber and noted that unlicensed taxis could be fined up to 2,000 euros. It is not Uber’s first problem in Europe: Paris briefly instituted a 15-minute wait time on Uber-like services, and in April, a court in Brussels banned the service there.

Right now, the services are trying to keep the peace by finding common ground with their competitors.

“Why does a taxi license cost that much?” asks Uber’s Gore-Coty.

Similarly, Merchiers of Airbnb points to regulation as the issue. “What we’re voting for is that instead of overregulating one sector and under-regulating others is that everyone has fair regulation,” he says.