ReactVision / starter-kit

React Native project setup with Viro 🚀
MIT License
127 stars 90 forks source link

Undefined is not an object #34

Closed retr00h closed 2 years ago

retr00h commented 2 years ago

Hello

I have followed closely each instruction in React Native docs to set up the development environment (React Native CLI Quickstart > Windows > Android), on a machine running Windows 10 and another machine running a fresh install of Windows 11.

I then cloned this repository, followed each instruction (excluding the npx pod-install command since I'm on Windows) without modifying any file, the only exception being a local.properties file I added in starter-kit\android\ with this one line inside: sdk.dir="C:\Users\Fabio\\AppData\Local\Android\Sdk".

After connecting a physical device (Samsung SM-A505FN, running Android 11), which is listed in adb devices I tried running npx react-native run-android, which resulted in the app being built and installed on my device successfully.

As the app opens though I'm having a TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[4], "@viro-community/react-viro").ViroConstants.TRACKING_NORMAL') both in Metro and on my device, signaling an error in App.js at line 15. The camera is being used and I can see "Initializing AR..." This exact same error happens on both my machines, with multiple devices (Samsung Galaxy A50 with Android 11, Huawei P20 lite with Android 9, Honor Play with Android 9).

How can I solve this and have "Hello World" appear instead of "initializing AR..." without that error?

Here are some images (from the Samsung Galaxy A50 running Android 11)... Screenshot_20220330-100026_My Viro App Screenshot_20220330-100056_My Viro App

Dolpheyn commented 2 years ago

You have to change to import ViroTrackingStateConstants instead of import ViroConstants.

retr00h commented 2 years ago

It works now, I can see the Hello World through AR. Thank you!

alex-voytko commented 1 year ago

Hi, there! Thanks! I had the same problem and it was solved! But now I can not see "Hello world!" because it unavailable ..

Screenshot 2023-05-31 at 10 01 09

photo_2023-05-31_10-07-26

Screenshot 2023-05-31 at 10 09 39

I am seeing my initial (preparing) text content because it moved to this condition: state === ViroTrackingStateConstants.TRACKING_UNAVAILABLE) Why unavailable ?