parse-community / Parse-SDK-Android

The Android SDK for Parse Platform
https://parseplatform.org/
Other
1.88k stars 739 forks source link

i/o failure #1184

Closed sjxuereb closed 1 year ago

sjxuereb commented 1 year ago

New Issue Checklist

Issue Description

With Android Parse SDK I am getting [ i/o failure ] when I try to upload an image file. I have also tried with a drawable converted to byte. I get the same result. [ i/o failure ]

However I manage to upload image [png/jpg] files with REST API successfully to my parse server. And I also manage to upload text files using Android Parse SDK Successfully. Just no image files etc.. The following works:

byte[] data = "Working at Parse is great!".getBytes(); ParseFile file = new ParseFile("resume.txt", data);

I have a very good internet connection and I have these in my manifest I can also create parse objects successfully.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />

It is not a permissions issue as I manage to upload to text files to the same parse class via an authenticated user.

Steps to reproduce

File dir = Environment.getExternalStorageDirectory(); File yourFile = new File(dir, "DCIM/Camera/20181010_001137.png");

        if(yourFile != null) {
            Log.i("App Log", "File Found");
        } else {
            Log.i("App Error", "File NOT Found");
        }

        ParseFile file = new ParseFile(yourFile);

        // Upload the image into Parse Cloud
        file.saveInBackground(new SaveCallback() {
            public void done(ParseException e) {
                if (e != null) {
                    Log.i("App Error", e.getMessage());
                } else {
                    Log.i("App Log", "File Uploaded");
                }
            }
        });

Actual Outcome

With Android Parse SDK I am getting [ i/o failure ] when I try to upload an image file. However I manage to upload PNG and JPG with REST API on the same server and associate them to Parse Objects successfully.

Expected Outcome

I need a successful upload

Environment

Parse Android SDK

Server

Database

Logs

parse-github-assistant[bot] commented 1 year ago

Thanks for opening this issue!

mtrezza commented 1 year ago

i/o failure points to a fundamental network issue between the app and the server, for example a firewall or blocked connection / protocol / URL on your device. You may want to check the URL the Parse Android SDK uses to connect to the server, especially the protocol (http vs. https).

I'm closing this as it does not seem to be a Parse Android SDK issue.

Feel free to comment if you have any questions and we can re-open this issue.