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

[Android] When using this package with react-native-camera get {"framesToPop": 1, "code": EUNSPECIFIED} #84

Open
watadarkstar opened this issue May 29, 2018 · 3 comments

Comments

@watadarkstar
Copy link
Contributor

I get this error on Android only when I try to upload a file using a uri from react-native-camera:

{"framesToPop": 1, "code": EUNSPECIFIED}

My upload code:

// Attempt to start file upload
  try {
    uploadId = await Upload.startUpload(options);
  } catch (e) {
    console.log("failing here");
    dispatch(messageFailed(uploadingMessage, I18n.t("messageFailedUpload"), e));
  }

My camera code:

startRecording = () => {
    if (this.camera) {
      this.camera
        .recordAsync({})
        .then(data => {
          console.log("data", data);
          this.props.upload(data.uri);
          this.navigateToChat();
        })
        .catch(err => console.error(err));
      this.setState({
        isRecording: true
      });
    }
  };

Not sure if this is a problem in this package or with react-native-camera. Any ideas as to what this error message means?

A workaround I have for now is: I copy the file using RNFS.copyFile(uri,dest) and use the destination uri (dest) and feed that to the uploader. But it would be nice if I could get rid of this workaround and just use the uri provided by react-native-camera.

@iworkinprogress
Copy link

Any updates on this? Running into this issue as well

@APZelos
Copy link
Contributor

APZelos commented Feb 19, 2019

Do you remove the file:// part from the path? For me, this resolved this issue.

Changed this:

const options = {
  path: videoFilePath,
  ...otherOptions,
}

const uploadId = await Upload.startUpload(options);

To this:

const options = {
  path: Platform.OS === 'ios' ? videoFilePath : videoFilePath.replace('file://', ''),
  ...otherOptions,
}

const uploadId = await Upload.startUpload(options);

@khodarahmi
Copy link

I've same issue (only on android 8+) and above workaround could not solve mine. Has anybody other suggestion?

react-native-background-upload: 5.1.0
react-native: 0.55.4

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

No branches or pull requests

4 participants