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

CFRelease(NULL) crash, with Video #42

Closed
assaqqaf opened this issue Apr 18, 2019 · 2 comments · Fixed by #43 or #66
Closed

CFRelease(NULL) crash, with Video #42

assaqqaf opened this issue Apr 18, 2019 · 2 comments · Fixed by #43 or #66
Labels

Comments

@assaqqaf
Copy link
Contributor

The new URI schema returned by PhotoKit (e.g: ph://....). Cause A problem with Image component for a video URI.

<Image source={{ uri: 'ph://fsdE.....' }} />

react-native info output:

  React Native Environment Info:
    System:
      OS: macOS 10.14.4
      CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
      Memory: 7.51 GB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 11.13.0 - /usr/local/bin/node
      Yarn: 1.15.2 - /usr/local/bin/yarn
      npm: 6.7.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5314842
      Xcode: 10.2/10E125 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0 
      react-native: 0.59.2 => 0.59.2 
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native: 0.59.1

Example code:

import React, {Component} from 'react';
import {Image, FlatList} from 'react-native';
import CameraRoll from "@react-native-community/cameraroll";

export default class App extends Component {
  state = {
    images: [],
  };

  componentDidMount() {
    CameraRoll.getPhotos({
      first: 10,
      groupTypes: "All",
      assetType: "Videos",
    })
    .then((data) => this.setState({ images: data.edges }));
  }

  render() {
    return (
      <FlatList
        data={this.state.images}
        renderItem={({item}) => (
            <Image
              style={{width: 50, height: 50}}
              source={{uri: item.node.image.uri}}
            />
        )}
      />
    );
  }
}

Before PhotoKit the above code was working. But now it triggers an error.

Screenshot 2019-04-11 at 10 14 06 AM

@OmarBasem
Copy link

Yes, I have the same issue, after some research I found that the app crashes because that uri is a uri for an image (the video's thumbnail) not a video, but unfortunately so far I did not find a fix.

jwaldrip added a commit to gigsmart/react-native-cameraroll that referenced this issue Jun 25, 2019
bartolkaruza pushed a commit that referenced this issue Jun 26, 2019
@bartolkaruza
Copy link
Collaborator

🎉 This issue has been resolved in version 1.1.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
3 participants