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

IllegalArgumentException at AndroidNetworkListener.setupNetworkCallback #220

Closed
shawn-lin-013 opened this issue Aug 14, 2024 · 6 comments
Closed

Comments

@shawn-lin-013
Copy link

Fatal Exception: java.lang.IllegalArgumentException: Too many NetworkRequests filed
       at android.os.Parcel.readException(Parcel.java:1687)
       at android.os.Parcel.readException(Parcel.java:1636)
       at android.net.IConnectivityManager$Stub$Proxy.listenForNetwork(IConnectivityManager.java:2375)
       at android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:2790)
       at android.net.ConnectivityManager.registerNetworkCallback(ConnectivityManager.java:3009)
       at com.amplitude.android.utilities.AndroidNetworkListener.setupNetworkCallback(AndroidNetworkListener.kt:59)
       at com.amplitude.android.utilities.AndroidNetworkListener.startListening(AndroidNetworkListener.kt:32)
       at com.amplitude.android.plugins.AndroidNetworkConnectivityCheckerPlugin.setup(AndroidNetworkConnectivityCheckerPlugin.kt:42)
       at com.amplitude.core.platform.Timeline.add(Timeline.kt:23)
       at com.amplitude.core.Amplitude.add(Amplitude.kt:465)
       at com.amplitude.android.Amplitude.buildInternal$suspendImpl(Amplitude.kt:61)
       at com.amplitude.android.Amplitude.buildInternal(Amplitude.kt:1)
       at com.amplitude.core.Amplitude$build$built$1.invokeSuspend(Amplitude.kt:114)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
       at java.lang.Thread.run(Thread.java:761)
        

Environment

  • Amplitude SDK Version: 1.16.7
@yogarunner
Copy link

We are seeing a large number of crashes caused by android.net.ConnectivityManager$TooManyRequestsException in our latest releases after updating to the new Amplitude-Kotlin SDK (Version: 1.16.7), which seems related to this issue.

We will try disabling Offline mode for now to hopefully prevent these crashes.
https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk#offline-mode

@izaaz
Copy link
Collaborator

izaaz commented Aug 20, 2024

Thanks for raising this folks. Taking a look.

@izaaz
Copy link
Collaborator

izaaz commented Aug 20, 2024

@yogarunner @shawn-lin-013 - do you have a way of reproducing this issue?

@yogarunner
Copy link

@yogarunner @shawn-lin-013 - do you have a way of reproducing this issue?

I tried last week but was unable to find a reliable way to reproduce the crashes we are seeing in prod.

@shawn-lin-013
Copy link
Author

@yogarunner @shawn-lin-013 - do you have a way of reproducing this issue?

Hi @izaaz, We can't reproduce the issue either. 😢

@izaaz
Copy link
Collaborator

izaaz commented Aug 21, 2024

Thanks @yogarunner @shawn-lin-013. We've added a try catch around the network connectivity listener so it should at least not cause any crashes. Thanks for reporting the issue!

@izaaz izaaz closed this as completed Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants