Skip to content
New issue

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

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

Already on GitHub? # to your account

MarshmallowNetworkObservingStrategy.java line 80 #462

Open
agarajaev opened this issue Dec 1, 2021 · 4 comments
Open

MarshmallowNetworkObservingStrategy.java line 80 #462

agarajaev opened this issue Dec 1, 2021 · 4 comments
Labels

Comments

@agarajaev
Copy link

The bug is reproduce only on 11 android when call ReactiveNetwork.observeNetworkConnectivity(context)

https://android-review.googlesource.com/c/platform/frameworks/base/+/1758029/

In ExoPlayer it is fixed like this
google/ExoPlayer@2e21208

android.net.ConnectivityManager.registerNetworkCallback (ConnectivityManager.java:4564)
com.github.pwittchen.reactivenetwork.library.rx2.network.observing.strategy.MarshmallowNetworkObservingStrategy.observeNetworkConnectivity (MarshmallowNetworkObservingStrategy.java:80)
com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork.observeNetworkConnectivity (ReactiveNetwork.java:92)
com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork.observeNetworkConnectivity (ReactiveNetwork.java:73)

Could you please catch this exception in library?
Thanks.

@pwittchen
Copy link
Owner

Thanks for reporting this. I'll have a look on that.

@pwittchen pwittchen added the bug label Dec 1, 2021
@Fando
Copy link

Fando commented Feb 7, 2022

Hi there,

Thanks for a wonderful library. Just following up on this issue. It's a known bug in Android 11, which was fixed in Android 12. However, the only workaround for it in Android 11 requires catching the exception when calling ConnectivityManager.registerNetworkCallback, in MarshmallowNetworkObservingStrategy.observeNetworkConnectivity.

Please catch this exception by scheduling a periodic retry call to registerNetworkCallback, mmmkay!

Cheers!

Caused by java.lang.SecurityException
Package android does not belong to xxxxx
android.os.Parcel.createExceptionOrNull (Parcel.java:2385)
android.os.Parcel.createException (Parcel.java:2369)
android.os.Parcel.readException (Parcel.java:2352)
android.os.Parcel.readException (Parcel.java:2294)
android.net.IConnectivityManager$Stub$Proxy.listenForNetwork (IConnectivityManager.java:4703)
android.net.ConnectivityManager.sendRequestForNetwork (ConnectivityManager.java:4191)
android.net.ConnectivityManager.registerNetworkCallback (ConnectivityManager.java:4594)
android.net.ConnectivityManager.registerNetworkCallback (ConnectivityManager.java:4564)
com.github.pwittchen.reactivenetwork.library.rx2.network.observing.strategy.MarshmallowNetworkObservingStrategy.observeNetworkConnectivity (MarshmallowNetworkObservingStrategy.java:40)
com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork.observeNetworkConnectivity (ReactiveNetwork.java:10)
com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork.observeNetworkConnectivity (ReactiveNetwork.java:29)
(ReactiveNetworkWrapper.java:2)
...

@HappyDr0id
Copy link

Hi 👋 +1 about the comment just above, I also encounter this crash on Android 11 devices. I'm catching the exception but if the library could handle it in a nicer way, that would be great 🙂

@guillaumeAgisHeetch
Copy link

Hello,
any update ?

Thanks

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants