Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
marcardar opened this issue Oct 31, 2024 · 3 comments
Assignees

Comments

@marcardar
Copy link

[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) 
}.
@cherylEnkidu
Copy link
Contributor

Hi @marcardar

Thanks for your report! Could you please share more info about this? For example, how long have you noticed this issue happened? Is there any Firebase SDK upgrade in your content provider in the last half year? Do you see it before the content provider upgrading Firestore SDK?

@marcardar
Copy link
Author

I only started noticing this in the past couple of weeks. Roughly around the time I updated my device to Android 15 and my apps to target Android 15. I frequently update my Firebase SDK version when the stable version is released. In the past month these were when I updated the firestore SDK:

Oct 31: firebase-bom = "33.5.1"
Oct 22: firebase-bom = "33.5.0"

I've been using the content provider in this way for over a year. It's not so much that the content provider is causing a problem, but I suspect more that the app is accessing firestore from the background.

@cherylEnkidu
Copy link
Contributor

Hi @marcardar , we didn't find any release on Android 15 relates to restriction of background app connectivity issue so far. I will make a note for this, and update you if we have any findings. In the meantime, if you find anything might be related to this issue, please feel free to leave a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants