Closed dev-hussein closed 5 years ago
Hi @TuiyTuyHussein at the moment the library does not support android 9.0, we hope to be able to perform some updates on the library soon!
I've been looking into this error. The problem comes from these changes
Framework Security Changes in API 28 Basically, for API 28+ no connection to clear text domains are permitted by default. Merlin
is using http://connectivitycheck.android.com/generate_204
to test connectivity, so when the demo project is compiled targeting API 28 the PingTask
is always returning false.
There are two possible solutions for the problem:
Merlin
is using by default in Endpoint
to https://connectivitycheck.android.com/generate_204
connectivitycheck.android.com
I've tested both solutions and they work well so it's just a matter of choosing what is best for the library.
This is the content of the network security config that I've tested
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">connectivitycheck.android.com</domain>
</domain-config>
</network-security-config>
As a workaround until this issue is addressed by the library you have two options @TuiyTuyHussein
.withEndpoint(Endpoint.from("https://connectivitycheck.android.com/generate_204"))
to Merlin.Builder()
when you create your Merlin
instanceMerlin
(or add the relevant content if you already have one in your project)I'm down for updating the default endpoint to use the https
version, there's a slight performance hit but it should be negligible.
This might actually fix an issue with false positives from some wifi hotspots which force redirects on http
to their hotspot login page
looks like #177 has been merged, the next release should contain this fix!
Problem
When test your repo it's not working on android 9.0 always return false.
Potential Solution
_I think you have to check https://developer.android.com/about/versions/pie/android-9.0-changes-all#restricted_access_to_wi-fi_location_and_connection_information_