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

Cleartext HTTP traffic to 10.0.2.2 not permitted #1

Closed
misici234 opened this issue Aug 31, 2020 · 1 comment
Closed

Cleartext HTTP traffic to 10.0.2.2 not permitted #1

misici234 opened this issue Aug 31, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@misici234
Copy link

Hi,

I created brand new Flutter project, copied and pasted your code there added my server URL and hub name and got the following error
Cleartext HTTP traffic to 10.0.2.2 not permitted
The Server URL points to SignalR server which works good with other packages (therefore, that one is not a problem). Please see the attached screenshot. I tried many thing to resolve this problem and I was just getting other errors. Please help.
image

@AyonAB
Copy link
Contributor

AyonAB commented Sep 6, 2020

@misici234 you are trying to connect with an HTTP url instead of HTTPS. I will recommend you to move your url to HTTPS.

But if you absolutely need to connect with a HTTP url, then you need to add the following lines in the manifest of your android source.

<application android:usesCleartextTraffic="true">
    </application>

This is because of Network Security Config, which says,

Starting with Android 9 (API level 28), cleartext support is disabled by default.

If you need more helps on this, read this Stackoverflow Thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants