What I am doing
So, I connected two of my applications to the same database one is using real-time database and I successfully migrated some of the data from real-time database to cloud firestore using cloud functions and the other application is using cloud firestore.
The firebase auth is working fine for both the applications, first application is successfully fetching the data from real-time database
What my problem is
but the problem is the second app is unable to fetch the data from cloud firestore, so I successfully catch the exception and it says "com.google.firebase.firestore.FirebaseFirestoreException: PERMISSION_DENIED: Missing or insufficient permissions."
What I did to resolve
so from the exception I am able to figure out that it's a permission issue, so I changed my rules for the cloud firestore
Earlier firestore rule
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if true;
}
}
}
Changed firebase rules
so I tried both of the below rule one by one to resolve the issue
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
}
}
and
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write;
}
}
}
but unfortunately none of the above is able to solve the issue I am still getting the same exception even after publishing the new rules
UPDATE
screenshot of the current firestore rules

Kotlin code
class Toppers {
private val firestore:FirebaseFirestore by lazy{
FirebaseFirestore.getInstance()
}
private val toppersList = mutableListOf<Topper>()
private val toppers = MutableLiveData<List<Topper>>()
init {
toppers.value = toppersList
}
fun getToppers():LiveData<List<Topper>>
{
firestore.collection("Toppers").get().addOnCompleteListener { task ->
if(task.isSuccessful)
{
toppersList.clear()
for(topper in task.result!!)
{
Log.d("(Saquib)","data is fetched "+topper.get("name").toString())
toppersList.add(
Topper(topper.get("name").toString(),
topper.get("percentage").toString(),
topper.get("imgurl").toString(),
topper.get("resulturl").toString(),
topper.get("rollno").toString(),
topper.get("schoolname").toString(),
topper.get("session").toString(),
topper.get("stream").toString(),
topper.get("standard").toString())
)
}
}
else
{
Log.d("(Saquib)","unable to fetch the data "+task.exception?.cause.toString())
}
}.addOnCompleteListener {
toppers.value = toppersList
}
return toppers
}
}
Android Logs
(Saquib): unable to fetch the data io.grpc.StatusException: PERMISSION_DENIED: Missing or insufficient permissions.
can anyone please help me out, i'll be really thankful to you