Parse-SDK-Android icon indicating copy to clipboard operation
Parse-SDK-Android copied to clipboard

Failedcom.parse.ParseRequest$ParseRequestException: i/o failure

Open ChanManChan opened this issue 5 years ago • 7 comments

i followed your steps and cant seem to write onto the server. please help trying to make this work since 2 days doubt

ChanManChan avatar Oct 14 '19 00:10 ChanManChan

should i download something from code section ? or simply following the rules is enough?(like adding the dependencies and adjusting the manifest and entering the appID ,client key and serverurl)

ChanManChan avatar Oct 14 '19 00:10 ChanManChan

Hi! @ChanManChan I had the same problem in my case was because upgrade my app to androidX, maybe this link helps you https://github.com/parse-community/Parse-SDK-Android/issues/968

Resume:

According to Network security configuration -

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

Also have a look at - https://koz.io/android-m-and-the-war-on-cleartext-traffic/

Option 1 -

Create file res/xml/network_security_config.xml -

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">Your URL(ex: 127.0.0.1)</domain>
    </domain-config>
</network-security-config>
AndroidManifest.xml -

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        ...
        android:networkSecurityConfig="@xml/network_security_config"
        ...>
        ...
    </application>
</manifest>

Option 2 -

android:usesCleartextTraffic Doc

AndroidManifest.xml -

<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
    <uses-permission android:name="android.permission.INTERNET" />
    <application
        ...
        android:usesCleartextTraffic="true"
        ...>
        ...
    </application>
</manifest>

Also as @david.s' answer pointed out android:targetSandboxVersion can be a problem too -

According to Manifest Docs -

android:targetSandboxVersion

The target sandbox for this app to use. The higher the sandbox version number, the higher the level of security. Its default value is 1; you can also set it to 2. Setting this attribute to 2 switches the app to a different SELinux sandbox. The following restrictions apply to a level 2 sandbox:

The default value of usesCleartextTraffic in the Network Security Config is false. Uid sharing is not permitted. So Option 3 -

If you have android:targetSandboxVersion in then reduce it to 1

AndroidManifest.xml -

<?xml version="1.0" encoding="utf-8"?>
<manifest android:targetSandboxVersion="1">
    <uses-permission android:name="android.permission.INTERNET" />
    ...
</manifest>

I copy that from this link https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted

kesmile avatar Oct 16 '19 22:10 kesmile

@kesmile thanks a lot man I got stuck in this problem and surfed through internet for answer for long time. you're a life saver. thanks!

amrit06 avatar Nov 14 '19 10:11 amrit06

@kesmile You're my fav person today!

gurpartapsinghh avatar May 06 '20 06:05 gurpartapsinghh

I've tried the solution above, but it's not working for me. I tried connecting to the same server on an older android project with android version 22 and 2.2.0 gradle, and everything works there.

Anyone else still having this issue? It's a new project so there's nothing in there that wasn't automatically created or on the readme for this project and I'm sure the server is working with almost nothing in it.

JZhou717 avatar Jul 27 '20 14:07 JZhou717

I've too tried the solution but still it's not working. com.parse.ParseRequest$ParseRequestException: i/o failure this error is showing up.

suvragcelt2019 avatar Sep 11 '20 18:09 suvragcelt2019

I solve this problem by using right IPv4 Public IP which will given in AWS

don't use IP like 127.0.0.1 or localhost use AWS IPv4 Public IP

your serverURL should not be look like this http://127.0.0.1/parse/ or http://local:1337/parse/

it should look like this example http://182.100.123.231/parse

just get your IPv4 Public IP address from AWS

Anil567849 avatar Sep 01 '21 16:09 Anil567849