I had the exact same thing, with errors mainly due to wrong Firestore.rules. Here is how I solved it:
The AI is stuck in an endless loop trying to fix an error (and how to solve it)
My recommendation is that you take it “outside” to ChatGPT or Gemini. The prompt should look something like this:
Here is my Firestore.rules: {copy-paste your rules here}
Here is file1: {copy-paste file1 content here, or attach the file (works better in Gemini)}
Here is file2, file3… (simply copy-paste or attach all the latest files Firebase Studio was trying to update in that session)
Describe what you wanted your app to do, and what is not working, or copy-paste the error code if any.
You should get a detailed step-by-step on how to solve it. You can take it straight to Firebase Studio as a prompt. If it is too long or complicated, and Firebase Studio struggles, feed it step-by-step, and test it.
You might need one more iteration outside of Firebase Studio using ChatGPT or Gemini, but I guarantee success! Especially with a normalized Firestore database with complex permissions, rules, and user roles.