Treat this situation as an opportunity. It is your PhD and you have to find the way. You're doing it here, so let me give some generic advice, which could be greatly expanded.
When I contacted my advisor, he had an interesting project proposal.
Good, that's his project proposal, not yours. There will be certainly some aspect you can take up.
However, since I'm a foreigner, it turns out I'm not allowed to work in that area.
This needs elaboration. It could be that because you are a foreigner they are telling you you cannot work into it to give you some less interesting part of the work that no local wants to do. It could be other things though.
So, my advisor changed the project to something more generic, which ended up being very complex to address.
This tends to be the case in less interesting projects requiring lots of engineering and not fundamental improvements. Here, you typically want to make simplifying assumptions, develop a particular model. Starting from simple examples can lead you to determine whether there is something to do in the more complex situation. This is part of any scientific endeavour. For instance, from the field of mathematics, I once read Michael Atiyah's advice to PhD students was that most big theorems in mathematics have a particular simple but interesting special case.
The field has been stagnating since the early 2000s.
Here you start talking about facts under your control. You seem to believe that a field stagnating means there is nothing new to add. This is a common believe between PhD students. I recommend you to read Ramón y Cajal's book "Advice to a young investigator". He will tell you things like "in general, it can be said that there are no small problems, but small men that cannot see the relevance of the small problems", he will also talk about the novice "traps", like "believing in the exhaustion of scientific topics" which is what you seem concerned about here. While it is true that some scientific problems are more prolific than others in a given time, that doesn't mean that with the right advice you cannot obtain progresses worth of a PhD in any field.
At first, my studies were exciting, but as time went on, they seemed going no where. I don't know what to do.
By asking here, you're doing something good, gather the feedback and put it into practice.
My advisor gives me these pointless task, e.g. re-run the same computation with a larger number, keeping in mind the general formula exist!
You can always describe your understanding to your advisor. Focus on scientific facts and questions, avoid biased language like "pointless tasks", rather discuss ingenuously
whether these "tasks" help in making progress in your advisor's project (make him/her feel his project is the most important thing ever).
Our meetings are very short, only about five minutes, while his meetings with other students last over an hour. He is actively helping his other students to work with people outside our group, but I feel totally left out.
Good, you build character by working on your own. To do science you don't need to be helped, you need to have a focus on some topic and then apply (and learn) the scientific method. After that, you write your conclusions and that's it.
In general, don't focus on what others have but on what you have. Be creative with that. How can you improve? What resources can you gather? It is also important to distinguish your PhD research from your actual research after graduating. PhD is not the last research you will do, if you teach yourself how to do research in the first place.