viromedia/viro

ViroARTrackingTargets make the app crash

dejawho opened this issue · 1 comments

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Version: ViroReact version and React Native version "react": "16.8.3", "react-native": "0.59.9", "react-viro": "2.17.0"

Description

I have a simple application where I want to replace a static image with a video, so I create the target for the image, but as soon as they are created I got this error: null is not an object (evaluation ARTTrackingTargetsModules.createTargets), debugging it appears that inside ViroARTrackingTargets.createTargets this ARTTrackingTargetsModules.createTargets is called but ARTTrackingTargetsModules is undefined. I run the project with react-native run-android. Any solution to this?
I've started from the sample app and modified that, also I've also tried to run the plain sample app and it crash in some other point, is this Viro React still supported?

Reproducible Demo

import React, { Component } from 'react';
import {
  View,
} from 'react-native';

import {
  ViroARImageMarker,
  ViroARScene,
  ViroNode,
  ViroVideo,
  ViroDirectionalLight,
  ViroBox,
  ViroConstants,
  ViroARTrackingTargets,
  ViroMaterials,
  ViroText,
  ViroImage,
  ViroFlexView,
  ViroARObjectMarker,
  ViroAmbientLight,
  ViroARPlane,
  ViroAnimatedImage,
  ViroAnimations,
  Viro3DObject,
  ViroQuad,
  ART
} from 'react-viro';


ViroARTrackingTargets.createTargets({
  patternAnchor: {
    type: 'Image',
    source: require('./assets/pattern.jpg'), // source of the target image
    orientation: 'Up', // desired orientation of the image
    physicalWidth: 0.067, // with of the target in meters (10 centimeters in our case)
  },
});

export default class ViroTest extends Component {
  render() {
    return (
      <View style={{flex: 1}}>
        <ViroARScene displayPointCloud>
          <ViroAmbientLight color="#fff" />
            <ViroARImageMarker target={'patternAnchor'}>
              <ViroNode position={[0.0, 0.0, 0]}>
                    <ViroVideo
                        source={require('./assets/video.mp4')}
                        loop={true}
                        position={[0, 0, 0]}
                        scale={[1, 1, 0]}
                    />
                </ViroNode>
            </ViroARImageMarker>
        </ViroARScene>
      </View>
    );
  }
}

module.exports = ViroTest

I have the same problem, is the thread dead?