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: setDataSource failed: status = 0xFFFFFFEA when using include: ['imageSize', 'playableDuration'] #239

Closed
mikbry opened this issue Sep 25, 2020 · 7 comments · Fixed by #241
Labels

Comments

@mikbry
Copy link
Collaborator

mikbry commented Sep 25, 2020

Bug report

Summary

Using:

CameraRoll.getPhotos({ first: 20, assetType: 'Videos', include: ['imageSize', 'playableDuration', 'filename'];

I got a non catchable error on Android Samsung A3:

setDataSource failed: status = 0xFFFFFFEA

setDataSource
MediaMetaDataRetriever.java

setDataSource
MediaMetaDataRetriever.java 153

putImageSize
CameraRollModule.java 686

putImageInfo
CameraRollModule.java 572

putEdges
CameraRollModule.java 519

Environment info

System:
OS: macOS 10.15.6
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Memory: 2.41 GB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.6.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.7 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
Android SDK:
API Levels: 23, 27, 28, 29, 30
Build Tools: 27.0.3, 28.0.3, 29.0.2, 29.0.3, 30.0.1
System Images: android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: 12.0/12A7209 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_262 - /usr/bin/javac
Python: 3.8.5 - /usr/local/opt/python/libexec/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
npmGlobalPackages:
react-native: Not Found

React-native : 0.63.2
react-native-cameraroll: 4.0.0

Steps to reproduce

Run a simple code on a Samsung A3, with some videos in Gallery. In fact you need some files with 0 bytes or corrupted.

Should return data.edges filled with videos.
Instead it crash the app.

If you remove all includes it works but without necessary image infos.

What you expect

It should return all images, but corrupted ones should have null infos or an extra error parameters ?

@mikbry
Copy link
Collaborator Author

mikbry commented Sep 25, 2020

It is related to #226

bartolkaruza pushed a commit that referenced this issue Sep 29, 2020
## [4.0.1](v4.0.0...v4.0.1) (2020-09-29)

### Bug Fixes

* fix for crash on putImageSize due to photoDescriptor being null. ([#240](#240)) ([b6038a7](b6038a7)), closes [#226](#226) [#239](#239)
* Xcode 12 compatibility ([#234](#234)) ([24fa8aa](24fa8aa))
@mikbry
Copy link
Collaborator Author

mikbry commented Sep 29, 2020

Sorry to say that, but release 4.0.1 didn't fix the bug :-(

It is line 686 in CameraRollModule.java

retriever.setDataSource(photoDescriptor.getFileDescriptor());

photoDescriptor.getFileDescriptor() return a faulty descriptor and it is outside the try catch.
Also the same problem occurs in another function putPlayableDuration line 622.

I could make a PR if ok ? @bartolkaruza

mikbry added a commit to mikbry/react-native-cameraroll that referenced this issue Sep 29, 2020
@mikbry mikbry mentioned this issue Sep 29, 2020
4 tasks
@bartolkaruza
Copy link
Collaborator

Sorry to say that, but release 4.0.1 didn't fix the bug :-(

It is line 686 in CameraRollModule.java

retriever.setDataSource(photoDescriptor.getFileDescriptor());

photoDescriptor.getFileDescriptor() return a faulty descriptor and it is outside the try catch.
Also the same problem occurs in another function putPlayableDuration line 622.

I could make a PR if ok ? @bartolkaruza

A PR would be great, thank you @mikbry !

@mikbry
Copy link
Collaborator Author

mikbry commented Sep 30, 2020

The PR is here: #241

@hannojg
Copy link
Contributor

hannojg commented Dec 29, 2020

Okay, so I am on 4.0.1 and this issue is still happening 👀

@mikbry
Copy link
Collaborator Author

mikbry commented Jan 5, 2021

@bartolkaruza there is problem in release 4.0.1 it didn't include my fix:
v4.0.1...master

bartolkaruza pushed a commit that referenced this issue Jan 27, 2021
## [4.0.2](v4.0.1...v4.0.2) (2021-01-27)

### Bug Fixes

* RuntimeException on faulty video files ([#241](#241)) ([a83ad4c](a83ad4c)), closes [#239](#239)
* updated react dependency in podspec to enable build in Xcode 12 (for iOS >= 12) ([#260](#260)) ([4f16a5a](4f16a5a))
@bartolkaruza
Copy link
Collaborator

🎉 This issue has been resolved in version 4.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

3 participants