thank you for sharing your question with the Wefugees Community! I am sorry you are receiving your answer this late but as you probably know Wefugees is a plattform where mostly private individuals are answering questions and therefore not all questions can get answered in a short time.
I am new to this plattform and still would like to answer your question, so that either you or other people in your situation maybe still receive the information they are looking for:
In cases like yours the Dublin Regulation applies that basically determines which country is responsible for examining your asylum application. As a general rule you could say that the state you first entered is responsible (but there are exceptions of course f. e. because of family). In your case where one country issued a valid visa for you at some point there is even a paragraph in the Dublin Regulation about it:
Where the applicant is in possession of a valid visa, the Member State which issued the visa shall be responsible for examining the application for international protection, unless the visa was issued on behalf of another Member State (...). (Article 12 Nr. 2 of the Regulation)
Please also note that this is only an answer based on the little information we have about your case. So if you are still in this situation and need help, it could be useful for you to see a lawyer or - if you don´t have any money - a counselling centre for free. You can find adresses close to your location in Germany via this page: https://adressen.asyl.net/
All the best,