firebase / firebase/firebase-android-sdk

Unable to call firestore from content provider of background app in Android 15 (targetSdk=35)

Open
#6,419 17 comments 3 reactions 1 assignee Claimed by @cherylEnkidu View on GitHub
api: firestore
Dominant language
Java
Stars
2.6k
Forks
710
Avg merge
2d 23h
Merged PRs (30d)
34

Description

### [REQUIRED] Step 2: Describe your environment

* Android Studio version: Android Studio Ladybug | 2024.2.1 Patch 1
* Firebase Component: Firestore
* Component version: firebase-bom = "33.5.1"

### [REQUIRED] Step 3: Describe the problem

Since updating my Pixel 7a to Android 15 (and updating my apps' targetSdkVersion to 35), I've been seeing this in the logs. My app calls the content provider of one of my other apps. The other app (as part of its startup logic) calls firestore.

My working assumption, is that Android 15 has added new restrictions on background apps (i.e. the one with the content provider) accessing the internet. If this is correct, it would be good if the log message better reflected this. Or if there was an appropriate way for the app to first check this restriction before calling firestore.

```
(25.1.1) [WatchStream]: (b476562) Stream closed with status: Status{code=UNAVAILABLE, description=Unable to resolve host firestore.googleapis.com, cause=java.lang.RuntimeException: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
at io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:223)
at io.grpc.internal.DnsNameResolver.doResolve(DnsNameResolver.java:282)
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Caused by: java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname
at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:124)
at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103)
at java.net.InetAddress.getAllByName(InetAddress.java:1152)
at io.grpc.internal.DnsNameResolver$JdkAddressResolver.resolveAddress(DnsNameResolver.java:632)
at io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:219)
at io.grpc.internal.DnsNameResolver.doResolve(DnsNameResolver.java:282) 
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:318) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 
at java.lang.Thread.run(Thread.java:1012) 
}.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.