Viro: null is not an object (evaluating 'ARTrackingTargetsModule.createTargets')

Created on 4 Dec 2019  路  7Comments  路  Source: viromedia/viro

Environment

Please provide the following information about your environment:

  1. Development OS: Mac, Windows, Linux
    Mac
  2. Device OS & Version: What Android OS version (7.0, 8.0, etc.) or iOS version (11.0, 11.2) is your device running on?
    iOS 11.2
  3. Version: ViroReact version and React Native version
    react-viro: 2.17.0
    react-native-cli: 2.0.1
    react-native: 0.59.8
  4. Device(s): What device(s) are you are seeing the issue on (i.e. iPhone X, Samsung Note 8, etc)
    All iOS Devices.

Description

Describe your issue in detail. Include screenshots if needed. If this is a regression, let us know.
I am facing an issue while using the below function. I have tried to run it on React Native as well as on Expo but all the time I am facing the error on
ViroARTrackingTargets.createTargets({})
On this line it always says
null is not an object (evaluating 'ARTrackingTargetsModule.createTargets')

Reproducible Demo

Let us know how to reproduce the issue. Include a code sample, screen capture, video recording. The more information you provide, the better we can support you.
It can be produced by running on react native with xcode 10.2 or on expo. I can make a snack on expo if further details are needed.

All 7 comments

I have found issues in the
require('react-native').NativeModules.VRTMaterialManager;
and all the nativemodules used in this project. None of them is working. Commenting them makes it run but it doesn't work.
Any Solutions will be appreciated.

Hey! First, you need to update your react-native version to 0.59.9 to be compatible with your viromedia version. Second, do you really need a tracking target? if not, is better to remove that from code. Remember to set a target this way:

ViroARTrackingTargets.createTargets({
  target1: {
    source: require('path/to/file.png'),
    orientation: "Up",
    physicalWidth: 0.1 // real world width in meters
  }
});

Share some code if you need any help.
Cheers!

I have tried to use it in expo and on expo i am getting this error and secondly yes i need the target and the source path is available. Actually I am using the Code in figment-ar repo and tried the examples in the current repo but no success on anything.

Hey! That鈥檚 because Expo doesn鈥檛 support Viro, you should init it from a bare react-native project. Use this as guide: https://docs.viromedia.com/docs/quick-start . Don鈥檛 be afraid of initializing a new project and pulling the code you need. Aaaaaand be sure you are using react native 0.59.9 due to possible compatibility issues.

Yes Sure thanks I will try it. I initialized a React Native Project as well but will try with the latest Version this time. I will let you know. Thanks a lot for the guidance.

I know that react viro does not officially support 0.60 but it works for many, I have this error, how can I solve it?

Hey! That鈥檚 because Expo doesn鈥檛 support Viro, you should init it from a bare react-native project. Use this as guide: https://docs.viromedia.com/docs/quick-start . Don鈥檛 be afraid of initializing a new project and pulling the code you need. Aaaaaand be sure you are using react native 0.59.9 due to possible compatibility issues.

I'm having this issue as well. Using 0.59.9 from the ViroSample quick start guide.
In fact, the quick start project right out of the box without any modification crashes with the same error.

EDIT: I got it to work. I think the key step was running the setup-ide.sh script, since this changed the build configurations available to gradle, but this is exactly what I did:

  • Install all dependencies (node, watchman, watchman, react-native-cli, react-viro-cli).
  • Create a new project with react-viro init.
  • Run ./setup-ide.sh.
  • Run ./gradlew InstallArDebug inside the android subdirectory.
  • Run the installed application from my device.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Thomas101 picture Thomas101  路  3Comments

ascorbic picture ascorbic  路  4Comments

dimegusew picture dimegusew  路  3Comments

jungley picture jungley  路  3Comments

starantino picture starantino  路  6Comments